X-Git-Url: http://git.shiar.net/gitweb.cgi/perl/plp/.git/blobdiff_plain/ef6d542255046b6f50d7047d8e5a1d85b9f01042..4cbac41f4d1bef193cf955c6c854c8a9ed258119:/plp.cgi diff --git a/plp.cgi b/plp.cgi index 850e305..a16835c 100755 --- a/plp.cgi +++ b/plp.cgi @@ -1,22 +1,20 @@ #!/usr/local/bin/perl use v5.6.0; use PLP; +use strict; -die 'Wrong module version' if $PLP::VERSION ne '3.02'; - -use vars qw($DEBUG); +die 'Wrong module version' if $PLP::VERSION ne '3.06'; -use strict; { + @PLP::END = (); $PLP::code = ''; $PLP::sentheaders = 0; $PLP::inA = 0; $PLP::inB = 0; + $PLP::DEBUG = 1; delete @ENV{ grep /^PLP_/, keys %ENV }; } -$DEBUG = 1; - PLP::start(); { @@ -28,11 +26,13 @@ PLP::start(); *cookies = \%cookie; PLP::Functions->import(); # No lexicals may exist at this point. - eval qq{package PLP::Script; $PLP::code}; + eval qq{ package PLP::Script; $PLP::code; }; + PLP::error($@, 1) if $@ and $@ !~ /\cS\cT\cO\cP/; + eval { package PLP::Script; $_->() for reverse @PLP::END }; + PLP::error($@, 1) if $@ and $@ !~ /\cS\cT\cO\cP/; } - PLP::error($@, 1) if $@; + PLP::sendheaders() unless $PLP::sentheaders; select STDOUT; undef *{"PLP::Script::$_"} for keys %PLP::Script::; - PLP::sendheaders() unless $PLP::sentheaders; }