#!/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{q} = "\17"; #^Q
$header{'content-type'} = 'text/html';
-$header{'status'} = '200 OK';
+$header{status} = '200 OK';
$INTERNAL{code} = ReadFile($INTERNAL{file});
while ($INTERNAL{code} =~ s/<_(.*?)_>//s){
$INTERNAL{pre} = $1;
- eval $INTERNAL{pre};
+ {
+ no strict;
+ eval $INTERNAL{pre};
+ if ($@ && $DEBUG){
+ print "\nDebug:\n $@";
+ }
+ }
}
for (keys %header){
}
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($@);
+ }
}