Well, I have something to say to main poster and a reply to HZ.. To the main poster, start using CGI.pm it's really just as simple as:
#!/usr/bin/perl -wT
use CGI;
my $cgi = new CGI;
print $cgi->header;
And then just throw in CGI specific code as you learn it.. but you don't *need* any more lines than that, and to know that you can grab POST and GET data by calling $cgi->param();
As for the sample above.. there's no reason to put possibly large html files into a memory consuming array, better to just read them in and spit them out (unless of course the data needs to be manipulated):
open(HTML, "<$htmlfile") || die "ouch $!";
print <HTML>;
close(HTML);
-Syn0