vivekvp has asked for the wisdom of the Perl Monks concerning the following question:
How do I prevent the error without dropping the perl -w option? Or do I need to put in an code to check the value of $ar in the foreach loop?43 $sth=$dbh->prepare("select * from names where id=?"); 44 $sth->execute($poreq); 45 my @ar = $sth->fetchrow_array(); 46 foreach $ar (@ar) { 47 print "$ar \n"; 48 } 49 $sth->finish;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use of uninitialized value at?
by chromatic (Archbishop) on Oct 08, 2002 at 19:15 UTC | |
by grantm (Parson) on Oct 09, 2002 at 10:08 UTC | |
|
Re: Use of uninitialized value at?
by kabel (Chaplain) on Oct 08, 2002 at 19:15 UTC | |
by blakem (Monsignor) on Oct 09, 2002 at 04:09 UTC | |
|
Re: Use of uninitialized value at?
by dpuu (Chaplain) on Oct 08, 2002 at 20:42 UTC | |
|
Re: Use of uninitialized value at?
by BrowserUk (Patriarch) on Oct 08, 2002 at 19:17 UTC | |
by Chmrr (Vicar) on Oct 08, 2002 at 19:19 UTC |