in reply to fake SSI
a=shift;$a=~s/\\//g;$a=glob($a);$_=`cat $a`;print"Content-type: text/h +tml\n\n" ;while(/<!--#exec cgi="([^"]*)"-->/){$a=`$1`;$a=~s/\n/<br>\n/g; s/<!--#exec cgi="([^"]*)"-->/$a/}print;
Let's break that down. It appears that the first part is really meant to be:
which is just Win32-specific bad Perl for: $_= do { local($/); <> }; that is, take a file specified on the command line and read its contents into $_.my $a= shift @ARGV; $a =~ s#\\#/#g; $a= glob($a); $_= `cat $a`;
Now the next bit translates to:
which isn't so bad. A big unflexible, sure. If you aren't used to Perl's implicit $_, here is an alternate version:print "Content-type: text/html\n\n"; while( /<!--#exec cgi="([^"]*)"-->/ ) { my $a= `$1`; $a =~ s/\n/<br>\n/g; s/<!--#exec cgi="([^"]*)"-->/$a/ } print;
while( $_ =~ /<!--#exec cgi="([^"]*)"-->/ ) { my $a= `$1`; $a =~ s/\n/<br>\n/g; $_ =~ s/<!--#exec cgi="([^"]*)"-->/$a/; } print $_;
Does that help?
- tye (but my friends call me "Tye")
|
|---|