6 messages in com.mysql.lists.perlRe: Why is $sth->rows() uninitialized?
FromSent OnAttachments
KEVIN ZEMBOWER29 Mar 2005 11:42 
Greg Meckes29 Mar 2005 13:12 
KEVIN ZEMBOWER29 Mar 2005 13:33 
Rudy Lippan29 Mar 2005 13:39 
Greg Meckes29 Mar 2005 15:22 
KEVIN ZEMBOWER01 Apr 2005 12:05 
Subject:Re: Why is $sth->rows() uninitialized?
From:Rudy Lippan (rlip@remotelinux.com)
Date:03/29/2005 01:39:02 PM
List:com.mysql.lists.perl

On Tue, 29 Mar 2005, KEVIN ZEMBOWER wrote:

pandora:~:$ perl -lwe '1 if 0==undef' Use of uninitialized value in numeric eq (==) at -e line 1.

if ($sth->rows() == 0) { #THIS is line 70 print STDERR "Duplicate item found at line $ln: $_\n"; } else {

Use of uninitialized value in concatenation (.) or string at ./loadInventory.pl
line 70. Duplicate item found at line 1:

The last line is my STDERR output. The previous line is an error message. The trace() output seems to show rows() being set to '0' at line 70, which is "if ($sth->rows() == 0) {".

I don't understand perl says $sth->rows() isn't initialized, when it seems to be set to zero, and why this system isn't working in this program, but seems to work fine in my other one.

Thanks for any light you can shed on this problem.

My guess is that $_ is undef.

-r