RE: Subroutine Syntax

2003-06-15 Thread Charles K. Clarkson
david Greenhalgh <[EMAIL PROTECTED]> asked: : : Been banging my head on this, I'm obviously missing : something obvious, but I can't see what. Would someone : put me out of my misery? : : My code checks the value of a variable $status. : $status can have three values, 0,1,2. 0 is good, 1 : and 2

Re: Subroutine Syntax

2003-06-15 Thread Greenhalgh David
: : < DO STUFF> Comments in perl begin with #, not < Perl probably thinks you're referring to a file handle in angle brackets. Sorry, this is me using my own shorthand, everything is correctly #'d in the code. : sub error { : : : : if ($_[0]=1) { '=' is an assignment operator. You

Premature end of Script header

2003-06-15 Thread david Greenhalgh
Can anyone tell me what the error message "Premature end of script headers: $Lib /path/to/cgi" means in the httpd error_log file? This is one of those "Runs on the command line but not in the browser" questions. Permissions are set to 755 and a bit commenting out and simple testing shows that

Re: Problem with script headers.

2003-06-15 Thread Kristofer Hoch
--- Nicholas Davey <[EMAIL PROTECTED]> wrote: > Hi. > > Okay, I have been over my script about a hundred times, and all my > syntax is perfect. However, when I view my page on the net, I get > this: > > Internal Server Error > The server encountered an internal error or misconfiguration and was

RE: Subroutine Syntax

2003-06-15 Thread Kristofer Hoch
David, I the reason this worked for Scot and not you is something that is both simple and EASILY OVERLOOKED. Consider the lines. #Scot if ($_ == 1) { ^^---> Scot is using a comparison operator #David if ($_[0]=1) { ^--> You are using an assignment operator. So in ef

Re: Premature end of Script header

2003-06-15 Thread Kristofer Hoch
David, print "Content-Type: text/html\n\n"; # Inaccurate print "Content-type: text/html\n\n"; # Accurate The difference is in case sensitivity. Notice the word '-type:' Kristofer --- david Greenhalgh <[EMAIL PROTECTED]> wrote: > Can anyone tell me what the error message "Premature end of scrip

Re: Premature end of Script header

2003-06-15 Thread david Greenhalgh
Kristofer, You are correct, of course, when I transcribed into the email I "mis-Typed" I think, though that the root of my problem is in the file format that things were saved in, the test print was added afterwards to trace the error through (I thought that I was not getting stuff passed into

Re: Problem with script headers.

2003-06-15 Thread drieux
On Friday, Jun 13, 2003, at 07:45 US/Pacific, Nicholas Davey wrote: [..] failed to open log file fopen: Permission denied [Fri Jun 13 07:45:57 2003] [error] [client 64.207.81.146] Premature end of script headers: /cgi-bin/index.cgi Don't worry about the path. All that matt

Re: Premature end of Script header

2003-06-15 Thread drieux
On Sunday, Jun 15, 2003, at 05:36 US/Pacific, Kristofer Hoch wrote: [..] print "Content-Type: text/html\n\n"; # Inaccurate print "Content-type: text/html\n\n"; # Accurate The difference is in case sensitivity. Notice the word '-type:' actually volks, you really should do that a bit more safely wit