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
--
In reply to Scope is just not for Fresh Breath by notsoevil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |