Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Finding error: uninitialized value in concatenation?

by Roy Johnson (Monsignor)
on Mar 02, 2005 at 15:27 UTC ( [id://435866] : note . print w/replies, xml ) Need Help??


in reply to Finding error: uninitialized value in concatenation?

Just to be clear: is the line it refers to the print within the while in your example code? If one of the fetched columns is NULL, the variable it is assigned to will be undef.

You can group your my declarations, and you can use map to get rid of undefs:

while ( my( $giName, $gssName, $definition, $sequence ) = map {defined + ? $_ : ''} $sth2->fetchrow_array )
Or you can turn off uninitialized warnings within the while loop:
no warnings 'uninitialized';

Caution: Contents may have been coded under pressure.