in reply to use of DBI perl function fetchall_arrayref
No doubt there are other approaches that some would consider more "elegant" or "clever", but usually when dealing with basic query activity like this, the plain and simple loops with descriptive variable names is just the easiest way.my $rows = $sth->fetchall_arrayref; for my $row ( @$rows ) { my @fields = @$row; # do something with @fields... } # or, if the per-field activity is pretty dense: for my $row ( @$rows ) { for my $field ( @$row ) { # do something with $field... } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use of DBI perl function fetchall_arrayref
by kmullin5016 (Acolyte) on Jan 26, 2007 at 14:56 UTC | |
by davorg (Chancellor) on Jan 26, 2007 at 15:16 UTC | |
by kmullin5016 (Acolyte) on Jan 26, 2007 at 15:58 UTC | |
by davorg (Chancellor) on Jan 26, 2007 at 16:07 UTC | |
by Jenda (Abbot) on Jan 27, 2007 at 01:24 UTC | |
by Herkum (Parson) on Jan 26, 2007 at 17:55 UTC | |
by graff (Chancellor) on Jan 26, 2007 at 22:53 UTC |