in reply to I need help with my first CGI

Tip #1 from the Basic debugging checklist: diagnostics

If you're getting this error from a here-document, you may have included unseen whitespace before or after your closing tag or there may not be a linebreak after it.

Remove the space before the ending HTML:

print "Content-type: text/html\n\n"; print <<HTML; <html> <head> <title>A Simple Perl CGI</title> </head> <body> <h1>A Simple Perl CGI</h1> <p>Hello World</p> </body> HTML exit;

See also Troubleshooting Perl CGI scripts

Replies are listed 'Best First'.
Re^2: I need help with my first CGI
by Hramyzn (Novice) on Jul 16, 2014 at 18:39 UTC

    Oh, that was the problem. Thanks a lot. Although I should have paid more attention instead of immediately posting a question here :/ The worst thing is, I already knew the line would be taken literally (whitespace included) but I was too blind to see it.