notsoevil has asked for the wisdom of the Perl Monks concerning the following question:
my @data = (); while (@data = $sth->fetchrow_array){ print TSCH join(' ',@data),"\n"; }
The above was what I attempted after first using (which produced the same error):
while (my @data = $sth->fetchrow_array){ print TSCH join(' ',@data),"\n"; }
perldiag says:
Use of uninitialized value%s (W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables.
The while loop keeps looping until the expression evaluates to false. The fetchrow_array method returns an empty list when there is no more data, and Perl treats that as a false value; and so the loop stops. So I cannot see why join would see @data with an uninitialized value.
I am sure I am overlooking something obvious, but perhaps not. I, a humble acolyte, seek your wisdom.
--
notsoevil
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Scope is just not for Fresh Breath
by tilly (Archbishop) on Dec 28, 2000 at 22:55 UTC | |
by notsoevil (Pilgrim) on Dec 28, 2000 at 23:15 UTC | |
|
Re: Scope is just not for Fresh Breath
by chipmunk (Parson) on Dec 28, 2000 at 22:55 UTC | |
|
Re: Scope is just not for Fresh Breath
by 2501 (Pilgrim) on Dec 28, 2000 at 22:51 UTC | |
|
Re: Scope is just not for Fresh Breath
by adamsj (Hermit) on Dec 28, 2000 at 22:58 UTC |