-- Ronald J Kimball <[EMAIL PROTECTED]>
>> if ($row1 ne "") {
You're using the wrong test. It should be:
if( defined $row1 )
{
# deal with the row
...
}
else
{
print "Your row is empty."
}
If the operation may return undef at one level then you
have to check that level before checking further down to
avoid autovivication:
$referent->[0][1] ||= '';
automatically creates the [0] referent so that it has
someplace to store the [1] entry that's getting ''
stored in it. This means that if a caller wants to know
if something was stored at [0][1] it'll have to use
soemthing like:
if( defined $ref->[0] )
{
print "You have a row"
}
or
if( defined $ref->[0][1] )
{
print "The value at row 0, field 1 is $ref->[0][1]"
}
else
{
print "Sorry, boss, nothing there."
}
Point is that checking for a false value misses some
things which would be present but false ('0', '') and
won't check properly for nested levels of array that
have defined values in them which are present to hold
undef or false.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582