I my day of true foolishness, I wrote the following script to process existing HTML files.
#HTML Document Parsing Library (Version: .011) #By Andrew Kenton Mitchell, SSE (Andrew@AndrewKMitchell.com) #Created: February 26, 2001 #Last Modified: February 27, 2001 15:13 Eastern Time # #This library will read an existing HTML document and replace most sca +lars with the correct values. sub DisplayHTML() { $HTMLFileName = @_[0]; open(HTMLFNH,"<$HTMLFileName") || die "ERROR: Can't open $HTMLFile +Name: $!"; print "Content-type: text/html\n\n"; while ($HTMLLine=<HTMLFNH>) { chomp $HTMLLine; $HTMLLine =~ s/(\$[\w\[\]{}']+)/'"'.$1.'"'/gee; #Allows printi +ng of variable content. print "$HTMLLine\n"; } close(HTMLFNH); } sub DisplayHTMLOnly() { $HTMLFileName = @_[0]; open(HTMLFNH,"<$HTMLFileName") || die "ERROR: Can't open $HTMLFile +Name: $!"; while ($HTMLLine=<HTMLFNH>) { chomp $HTMLLine; $HTMLLine =~ s/(\$[\w\[\]{}']+)/'"'.$1.'"'/gee; #Allows printi +ng of variable content. print "$HTMLLine\n"; } close(HTMLFNH); } return 1;
Now, I been requested to make the script handle an SSI directives similar to:
#exec cmd="perl /usr/local/apache/cgi-bin/toolbar.cgi fastship"
Though I have suggested many times, I be allowed to take the script out, the powers at be refuse.
My fellow monks, I need your help. What is the easiest/best way to accomplish my goal? How can I make my code process an SSI like above?
Thanks,
akm2
In reply to SSI problem by akm2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |