git.shiar.nl
/
perl
/
plp
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
v2.21 release
[perl/plp/.git]
/
plp.cgi
diff --git
a/plp.cgi
b/plp.cgi
index c281fc0e17bc3965d14c5589f32a57fa462a6ec7..3bf77f9882d17b093afc6e4943ab31745105494a 100755
(executable)
--- a/
plp.cgi
+++ b/
plp.cgi
@@
-1,6
+1,9
@@
#!/usr/bin/perl
#!/usr/bin/perl
+use strict;
+use vars qw($VERSION %INTERNAL %get %post %fields %header %cookie %BLOCK $DEBUG $output);
-$VERSION = '2.01';
+$VERSION = '2.21';
+$DEBUG = 1;
$INTERNAL{file} = $ENV{PATH_TRANSLATED};
unless (-e $INTERNAL{file}){
$INTERNAL{file} = $ENV{PATH_TRANSLATED};
unless (-e $INTERNAL{file}){
@@
-24,7
+27,7
@@
$INTERNAL{qq} = "
\10
"; #^P
$INTERNAL{q} = "
\17
"; #^Q
$header{'content-type'} = 'text/html';
$INTERNAL{q} = "
\17
"; #^Q
$header{'content-type'} = 'text/html';
-$header{
'status'
} = '200 OK';
+$header{
status
} = '200 OK';
$INTERNAL{code} = ReadFile($INTERNAL{file});
$INTERNAL{code} = ReadFile($INTERNAL{file});
@@
-56,7
+59,13
@@
$INTERNAL{code} =~ s{print q$INTERNAL{q}$INTERNAL{q};}[]g;
while ($INTERNAL{code} =~ s/<_(.*?)_>//s){
$INTERNAL{pre} = $1;
while ($INTERNAL{code} =~ s/<_(.*?)_>//s){
$INTERNAL{pre} = $1;
- eval $INTERNAL{pre};
+ {
+ no strict;
+ eval $INTERNAL{pre};
+ if ($@ && $DEBUG){
+ print "\nDebug:\n $@";
+ }
+ }
}
for (keys %header){
}
for (keys %header){
@@
-64,11
+73,10
@@
for (keys %header){
}
print "\n";
}
print "\n";
-eval $INTERNAL{code};
-if ($@){
- print "<hr><b>Debug</b><br>", Entity($@);
-}
-
-if ($Debug){
- print "<hr>Debug:<pre>$INTERNAL{code}<hr>$output";
+{
+ no strict;
+ eval $INTERNAL{code};
+ if ($@ && $DEBUG){
+ print "<hr><b>Debug</b><br>", Entity($@);
+ }
}
}