Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: I need help with my first CGI

by toolic (Bishop)
on Jul 16, 2014 at 18:34 UTC ( [id://1093921]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1093921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found