Peter J. Holzer wrote:

or selectall_arrayhashref?
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.

Proposed use:

my $emp = $dbh->selectall_hasharrayref("select * from emp order by ename");

for (@$emp) {
    print "$_->{ename} ($_->{empno}): $_->{job}\n";
}

or

for ($first .. $last) {
    print $emp->[$_]{ename}, "\n";
}

or something like that.

What do you think?


The names are to vague and not accurate

selectall_arrayref_of_hashrefs() is what it is and anyone knows that immediately by looking at its name instead of having to look up its documentation

Reply via email to