Re: Why is $sth->rows() uninitialized?
KEVIN ZEMBOWER <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
Rudy, Garry, Greg, thank you all so much for your help. Rudy, you get the prize: it was $_ which was uninitialized. I played with a few fixes, then just eliminated it in the output of the print STDERR command. Don't know why I couldn't fix or detect it, but since this was just supposed to be quick'n'dirty script, and I'd already blown the 'quick' part, I just cut it out. Also don't know why the error pointed to the previous line. I'm continually amazed at the helpfulness of the Open Source community. I've never gotten as thoughtful and complete and quick responses to my questions from commercial software vendors. Thanks, again, so much. -Kevin >>> Rudy Lippan <[email protected]> 03/29/05 04:39PM >>> 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] -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected]