Hi !
I am a Perl newbie. I recently added the IIS 5.1 component to my computer running Win XP and configured it to run CGI programs.I use SiePerl.
I save my programs in k:\inetpub\wwwroot\cgi-bin.I can now successfully run programs from the browser using http://localhost/cgi-bin/<program name>.pl
But using using subroutines in my cgi programs is giving me a tough time.e.g.) When I run the following hello.pl from the browser using
http://localhost/cgi-bin/hello.pl it gives me the following error :
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
htmlhead.pl did not return a true value at k:\inetpub\wwwroot\cgi-bin\hello.pl line 1.
The following is the code for hello.pl.
require "htmlhead.pl";
require "htmlend.pl";
&html_header("What a wonderful day...");
print "<h1> Hello World\n";
&html_footer;
Code for htmlhead.pl
sub html_header
{
print "Content-type:text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>";
print "@_";
print "</title>\n</head>\n";
print "<body>\n";
}
And finally, the code for htmlend.pl
sub html_footer
{
print "\n</body>\n";
print "</html>";
}
Plz help...
Thank you