On Mon, Oct 22, 2001 at 12:36:16AM -0500, Steven Lembark wrote:
> 
> 
> -- Ronald J Kimball <[EMAIL PROTECTED]>
> 
> >> if ($row1 ne "") {

Please mind your attributions.  That was written by [EMAIL PROTECTED]
I was quoting his message, hence the extra level of >.


> You're using the wrong test. It should be:
> 
>     if( defined $row1 )
>     {
>         # deal with the row
>         ...
>     }
>     else
>     {
>         print "Your row is empty."
>     }

The test I used in my response was

if ($row1) {
}

which will work fine in this case, since fetchrow_hashref will return
either undef or a hash reference.

Using defined also works here, of course.


Ronald

Reply via email to