in reply to Where is my foreach data going to?
or even perlier:for ($i=0; $i<$qry->numrows; $i++) { @row = $qry->fetchrow or warn '...'; print "\@row is assigned @row\n"; $athlete[$i] = [ @row ]; }
or (I hate array subscripts):for my $i (0 .. $qry->numrows - 1) { @row = $qry->fetchrow() or warn '...'; $athlete[$i] = [ @row ]; }
ok, no2 looks better ;)for (1 .. $qry->numrows) { @row = $qry->fetchrow() or warn '...'; push @$athlete, [ @row ]; }
Update: Oops, and again i coded rusbish. Fixed code no3, now it no longer looks bad ;)
|
|---|