Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: RE: Using sybperl with cgi
Date: Feb 16 1999 8:04PM

>>>>> "Sheree" == Sheree Hemphill  writes:

Sheree> I did check the error log & it said the following:
Sheree> [16/Feb/1999:13:54:29] failure (15929): for host
Sheree> gene22797.GENE.CWRU.Edu trying to GET
Sheree> /cgi-bin/sah18/biares3.cgi, cgieng_scan_headers reports: the
Sheree> CGI program /var/www/htdocs/helix/cgi-bin/sah18/biares3.cgi
Sheree> did not produce a valid header (name without value: got line
Sheree> "use of uninitialized value at
Sheree> /var/www/htdocs/helix/cgi-bin/sah18/biares3.cgi line 25.")
>>  I *hate* web servers that direct STDERR messages ("use of
>> uninitialized value") to STDOUT and create this problem!

Sheree> Is there a way to change this somehow in the web server
Sheree> configuration?  Or is this just something I will have to live
Sheree> with?

I don't know. What web server are you using?

The only web server I know somewhat is Apache, and it definitely does
not do this!

>> Short term solution: remove the -w from the !#/usr/local/bin/perl
>> line at the top of your script.

>> The warning comes from perl - there's (probably) a NULL value in
>> your query result. When you print it out perl (with -w turned on)
>> prints this warning.

Sheree> This worked!  Yes, for some of the variables, some of the
Sheree> records do have null values.  Is there a way to still get the
Sheree> warning messages -- to route them to a file or something?

Not that I know of (which is not the same as saying that there is no

>>  One other thing that you should probably do is to turn off the
>> buffering of STDOUT. Place this near the top of your script:
>> select(STDOUT); $| = 1;

Sheree> What does adding this line change (sorry for my newness at
Sheree> this)?

STDERR is usually unbuffered, while STDOUT is usually buffered. This
means that although you had the

print header();

call first in the script, the warning message (generated by perl, on
STDERR) got to the web server first because STDOUT is buffered. 

By setting $| = 1 you unbuffer STDOUT, and this will (probably)
guarantee that your header will be seen by the web server first.