Re: Why is $sth->rows() uninitialized?

Rudy Lippan <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
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


-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.