On 2006-01-10 17:17:21 +0000, Tim Bunce wrote:
> On Tue, Jan 10, 2006 at 12:47:54PM +0100, Peter J. Holzer wrote:
> > Anyway, I rather frequently find that the "most natural" way to
> > represent a query result is an array of hashes: Each row is hashref, but
> > the the rows are in an array(ref) so that the order is preserved, and
> > the columns can be accessed by name.
[...]
> > What do you think?
> 
> Anything wrong with the existing
> 
>     my $emp = $dbh->selectall_arrayref("...", { Slice => {} });
> 
> ?

Nothing, except that I didn't know about it.

Looks like it was too obvious for me what fetchall_arrayref does (it
returns an arrayref, duh!) so I never read what it really does
(sometimes it returns a hashref).

> Please spread the word. Way too many people seem to not know about this!

Now there are a few people less who don't know about it. Maybe an example
in the man-page would make it clearer. OTOH, the DBI manpage is already
very long for a manpage (pod2latex DBI.pm produces a 98 page document).

        hp

-- 
   _  | Peter J. Holzer    | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR       | I'd be programming in Java.
| |   | [EMAIL PROTECTED]      | I don't, and I'm not.
__/   | http://www.hjp.at/ |   -- Jesse Erlbaum on dbi-users

Attachment: pgpoQ1oYpWm1d.pgp
Description: PGP signature

Reply via email to