in reply to perl - html

Looks ok to me. If you have commandline access on the webserver try executing it on the commandline. If it works as you expect then that eliminates a whole host of problems (like bad line endings, not being flagged as executable etc.). If it's a Windows server then there are even more things to consider.

I'd also echo the previous poster, to use CGI to simplify your interactions with http and html. Even better, use something like Template::HTML or HTML::Mason.

Here is your example using CGI in OO mode:

use strict; use CGI; my $q = new CGI; print $q->header; print $q->start_html('Hello World'); print $q->h2('Hello, world!'); print $q->end_html;