optional end tag for plp code
authorJuerd Waalboer <juerd@cpan.org>
Sat, 31 Mar 2007 00:27:44 +0000 (02:27 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 31 Mar 2007 00:27:44 +0000 (02:27 +0200)
PLP.pm

diff --git a/PLP.pm b/PLP.pm
index 2f9db4d6ea3a832c62e091f237168626d2ae8a0e..f4afee889c7d429e70c003db0f7b82f555d19f93 100644 (file)
--- a/PLP.pm
+++ b/PLP.pm
@@ -261,14 +261,14 @@ sub sendheaders () {
                my $part = $1;
                if ($part eq '<:=' and not $in_block) {
                    $in_block = 2;
-                   $source .= "\cQ, ";
+                   $source .= "\cQ, (";
                } elsif ($part eq '<:' and not $in_block) {
                    $in_block = 1;
                    $source .= "\cQ; ";
                } elsif ($part eq ':>' and $in_block) {
                    $source .= (
                          $in_block == 2
-                       ? ", q\cQ"               # 2
+                       ? "), q\cQ"              # 2
                        : "; $PLP::print q\cQ"   # 1
                    );
                    $in_block = 0;
@@ -285,6 +285,14 @@ sub sendheaders () {
                }
            }
        }
+       
+       if ($in_block) {
+           $source .= (
+                 $in_block == 2
+               ? "), q\cQ"              # 2
+               : "; $PLP::print q\cQ"   # 1
+           );
+       }
 
        if ($use_cache) {
            $cached{$path}[1] = $source;