From: Juerd Waalboer Date: Sat, 31 Mar 2007 00:27:44 +0000 (+0200) Subject: optional end tag for plp code X-Git-Tag: 3.18~3 X-Git-Url: http://git.shiar.net/perl/plp/.git/commitdiff_plain/668b6b454b1f7f05c6ff5f43afd088aabe3bd020 optional end tag for plp code --- diff --git a/PLP.pm b/PLP.pm index 2f9db4d..f4afee8 100644 --- 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;