in reply to How does DBI return an arrayref with key/value pairs?
From http://search.cpan.org/~timb/DBI-1.53/DBI.pm:
You may often want to fetch an array of rows where each row is stored as a hash. That can be done simple using:
my $emps = $dbh->selectall_arrayref( "SELECT ename FROM emp ORDER BY ename", { Slice => {} } ); foreach my $emp ( @$emps ) { print "Employee: $emp->{ename}\n"; }
So despite the name you get a reference to an array of hash references.
UPDATE: Have you tried looking at it using Data::Dumper? Should show the structure being a hash at the bottom.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How does DBI return an arrayref with key/value pairs?
by walkingthecow (Friar) on Jun 21, 2013 at 14:48 UTC | |
by locked_user sundialsvc4 (Abbot) on Jun 21, 2013 at 20:39 UTC |