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:
premature end of script headers....

 



Tom
Deleted

Jun 24, 2000, 10:19 PM

Post #1 of 3 (370 views)
premature end of script headers.... Can't Post

Hello,

I don't know what premature end of script headers means anyway so I don't know how to sort it out.

All that is in my script is


#!/usr/bin/perl


open (FILE, ">>/WebSites/hosted/dotcomper.co.uk/cgi-bin/testingnews/news.shtml"); {
print FILE "Content-type: text/html\n\n";
print FILE "<HTML><HEAD><TITLE>News</TITLE></HEAD>\n";
print FILE "<body><font color=red>$subject</p>\n";
print FILE "<font color=black>$message</p>\n";
print FILE "</body></html>\n";
close (FILE);
}


Can someone tell me why i get this error?


------------------
errrr, what?


Kanji
User / Moderator

Jun 25, 2000, 11:23 AM

Post #2 of 3 (370 views)
Re: premature end of script headers.... [In reply to] Can't Post

Premature end of script headers means the first thing out of your script was something other than a valid header.

Usually, it'll be an error, so you should check your web logs to see what they say went wrong, and/or try to run the script from a command line.

From your code, the problem appears to be that you don't return anything to the browser, let alone headers.

Also: always, always, always check the return value of open as it'll save you much grief.



mwaf
Deleted

Jun 26, 2000, 10:51 AM

Post #3 of 3 (370 views)
Re: premature end of script headers.... [In reply to] Can't Post

I might be wrong but I've never used {} when opening a file but the prob. is more likely what Kanji said...

BTW, I always get a 'prematur end of script headers' error unless I've done something very. So if you get this error again just check that you have all the ' " ) ] } ; correctly, also make sure print is written correctly as prnit will also cause a 'prem...' error.

 
 


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

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