I normally use print ( defined( $var ) ? $var : "NULL" )
Your Friendly Neighborhood DBA,
Chuck
[EMAIL PROTECTED] wrote:
and I-----Original Message----- From: Jesse, Rich [mailto:[EMAIL PROTECTED] Sent: Monday, April 26, 2004 10:12 AM To: '[EMAIL PROTECTED]' Subject: Correct way to deal with returned NULLs?
Howdy,
I have a question from one of our developers that's been bugging me
can't find an answer. Given this v1.37 DBI code fragement:$sth->fetchrow_array )
while ( my ($projectno,$description,$dateclosed) =
the{ print "$projectno"; print "$description"; print "$dateclosed"; print "\n"; }
...I keep getting a "Use of uninitialized value in string" message on
print of the $dateclosed variable, whenever the corresponding OracleDB
column is NULL. And you've already figured out that the program isrun
ofwith "-W". When the "-W" is dropped, no message.
This has got to be simple, but a read through the DBI FAQ, the index
Tim's book, and Google, and I'm still unable to provide a simpleanswer
that's probably staring me in the face, other than "Drop the -W".
How do others deal with this?
TIA, Rich
Rich Jesse System/Database Administrator
[EMAIL PROTECTED] QuadTech, Sussex, WI USA
