in reply to How to preserve all instances from a database in an array?
(did not compile this code) UPDATE: davidrw is of course right. I focused on your array question. the point is to push a reference in an array. you should read perldoc perlref.my @rec_data; while (my $data = $result->fetchrow_hashref) { push @rec_data, [ $data->{rec_no}, $data->{name}]; } for my $i ( 0 .. 9 ) { print $rec_data[$i]->[0]; print $rec_data[$i]->[1]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to preserve all instances from a database in an array?
by davidrw (Prior) on Mar 23, 2006 at 23:05 UTC |