#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 scalars with the correct values.
sub DisplayHTML() {
$HTMLFileName = @_[0];
open(HTMLFNH,"<$HTMLFileName") || die "ERROR: Can't open $HTMLFileName: $!";
print "Content-type: text/html\n\n";
while ($HTMLLine=) {
chomp $HTMLLine;
$HTMLLine =~ s/(\$[\w\[\]{}']+)/'"'.$1.'"'/gee; #Allows printing of variable content.
print "$HTMLLine\n";
}
close(HTMLFNH);
}
sub DisplayHTMLOnly() {
$HTMLFileName = @_[0];
open(HTMLFNH,"<$HTMLFileName") || die "ERROR: Can't open $HTMLFileName: $!";
while ($HTMLLine=) {
chomp $HTMLLine;
$HTMLLine =~ s/(\$[\w\[\]{}']+)/'"'.$1.'"'/gee; #Allows printing of variable content.
print "$HTMLLine\n";
}
close(HTMLFNH);
}
return 1;