CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
ERROR - Premature end of script headers:

 



ACGUY
New User

Nov 8, 2004, 7:27 PM

Post #1 of 3 (585 views)
ERROR - Premature end of script headers: Can't Post

Hi I tested working perl code on my local machine, but when I put the file in the CGI-BIN of my hosts server, i get a error.

Premature end of script headers:

Even when the code is a simple one line script..

Print "hello";

Any help?


(This post was edited by ACGUY on Nov 8, 2004, 7:28 PM)


davorg
Thaumaturge / Moderator

Nov 9, 2004, 1:57 AM

Post #2 of 3 (583 views)
Re: [ACGUY] ERROR - Premature end of script headers: [In reply to] Can't Post

What gets written to the web server error log?

What happens when you try to run the program from the command line on the server?

Can you give us a _complete_ short example of a non-working program?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


KevinR
Veteran


Nov 9, 2004, 12:14 PM

Post #3 of 3 (579 views)
Re: [ACGUY] ERROR - Premature end of script headers: [In reply to] Can't Post

you need to print an HTTP header first when printing stuff to a browser with perl.

#!perl
print "Content-type: text/html\n\n";
print "Hello World!";

if you use the CGI module then you can do it a couple of different ways. Read some CGI module tutorials or documentation. A simple google seach for "CGI module" will find plenty of online resources.

Wink
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives