in reply to Re: multidimensional array's
in thread multidimensional array's
A little known "feature" of fetchall_arrayref is that it will return an array of hashes if you supply it a hash, and if that hash is empty, it will return all the fields.
my @allrows = @{ $sth->fetchrow_arrayref({}) }; # Expand ref, to simpl +ify access
YMMV, but I always find it easier to look at $row{language} than $row[2]. I'm sure there's a mild performance hit, but as long as it's not incredibly slow I'd opt for clarity.
A Monk aims to give answers to those who have none, and to learn from those who know more.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: multidimensional array's
by NetWallah (Canon) on Dec 28, 2012 at 20:11 UTC | |
by emgi (Initiate) on Dec 29, 2012 at 09:20 UTC | |
by NetWallah (Canon) on Dec 29, 2012 at 15:56 UTC |
In Section
Seekers of Perl Wisdom