Gossamer Forum
Home : General : Perl Programming :

Confused...

Quote Reply
Confused...
Ok, can someone please tell me why the following script;

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print qq|
test

|;


doesn't work, but, the following does;

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print qq|
<html>
test

|;


The first script gives a 500 IS error, whilst the second one works. Why does the <html> bit make a difference?

Thanks

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: Confused... In reply to
Hi Andy:

They are both valid - did you upload the first one in Binary, or did your server cough when you uploaded it? The only error that I would expect in this case would be header-related but as I say these both are valid - on Unix, Linux and Cobalt RAQ. What does your server error logs tell you? What box are you on?


Dan Cool

LotusLand
Vancouver, BC, Canada
Top Ranked City in World for Quality of Life
Quote Reply
Re: Confused... In reply to
That is why I am confused. The error log says;

[Wed Jun 13 02:44:11 2001] [error] [client 172.138.113.55] Premature end of script headers: /home/ace-host/public_html/cgi-bin/test.cgi
[Wed Jun 13 02:44:11 2001] [error] (8)Exec format error: exec of /home/ace-host/public_html/cgi-bin/test.cgi failed


I'm on a Linux server. As far as I can tell it uploaded ok. I viewed the files when they where on the server, and they all seem to have been uploaded in the correct manner. I did have a few problems with my FTP client a few days ago. That could be what is causing the problem. I'll get a new one adn let you know how it goes.

Thanks

Andy

webmaster@ace-installer.com
http://www.ace-installer.com