[Melbourne-pm] fetchrow_array() vs fetchrow_arrayref() WAS RE: Perl DBI reference recommendations
Scott Penrose
scottp at dd.com.au
Thu Jul 16 23:49:37 PDT 2009
On 17/07/2009, at 4:45 PM, Craig Sanders wrote:
>
> i tend to use fetchrow_hashref() or fetchall_hashref() - that way i
> can
> use the sql column names to access the data and don't have to guess
> which array element matches which field....and, more importantly,
> don't
> have to renumber things when i add or remove a field to the select.
My fav is to use fetchall_arrayref({});
The "{}" (empty hash) tells fetchall_arrayref to return a array ref of
hash refs - all the advantages of the above, but returns it as an
arrayref.
Scott
More information about the Melbourne-pm
mailing list