X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/1376138c9392575534de671ce7b6fbb05a578e19..d7eecb5ca73d043897b6e49c14845bda97ba2202:/PLP.pm diff --git a/PLP.pm b/PLP.pm index 2f9db4d..a190e3b 100644 --- a/PLP.pm +++ b/PLP.pm @@ -10,11 +10,11 @@ use PLP::Tie::Print; use File::Basename (); use File::Spec; -use Cwd (); +#use Cwd (); use strict; -our $VERSION = '3.17'; +our $VERSION = '3.18'; # Subs in this package: # _default_error($plain, $html) Default error handler @@ -24,7 +24,7 @@ our $VERSION = '3.17'; # everything Do everything: CGI # handler($r) Do everything: mod_perl # mod_perl_init($r) Initialization for mod_perl -# mod_perl_print Faster printing for mod_perl +# mod_perl_print Faster printing for mod_perl # sendheaders Send headers # source($path, $level, $linespec) Read and parse .plp files # start Start the initialized PLP script @@ -68,7 +68,7 @@ sub cgi_init { delete @ENV{ qw(PATH_TRANSLATED SCRIPT_NAME SCRIPT_FILENAME PATH_INFO), - grep { /^REDIRECT_/ } keys %ENV + grep /^REDIRECT_/, keys %ENV }; $ENV{PATH_INFO} = $path_info if defined $path_info; @@ -172,7 +172,7 @@ sub mod_perl_init { # FAST printing under mod_perl sub mod_perl_print { - return if @_ == 1 and not length $_[0]; + return unless grep length, @_; PLP::sendheaders() unless $PLP::sentheaders; $PLP::r->print(@_); } @@ -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; @@ -346,7 +354,7 @@ PLP - Perl in HTML pages SetHandler perl-script PerlHandler PLP PerlSendHeader On - PerlSetVar PLPcache On + PerlSetVar PLPcache On # Who said CGI was easier to set up? :) @@ -367,10 +375,10 @@ PLP - Perl in HTML pages ScriptAlias /foo/bar/ /PLP_COMMON/ - AllowOverride None - Options +ExecCGI - Order allow,deny - Allow from all + AllowOverride None + Options +ExecCGI + Order allow,deny + Allow from all AddHandler plp-document plp Action plp-document /PLP_COMMON/plp.cgi @@ -525,9 +533,11 @@ FAQ at L. Some examples can be found at L. No warranty, no guarantees. Use PLP at your own risk, as I disclaim all responsibility. -=head1 AUTHOR +=head1 AUTHORS + +Currently maintained by Mischa POSLAWSKY -Juerd Waalboer +Originally by Juerd Waalboer =head1 SEE ALSO