in reply to Simpler DBI::MySQL queries

You are probably looking for selectrow_arrayref() (and its siblings).

$ary_ref = $dbh->selectall_arrayref($statement); $hash_ref = $dbh->selectall_hashref($statement, $key_field); $ary_ref = $dbh->selectcol_arrayref($statement); $ary_ref = $dbh->selectcol_arrayref($statement, \%attr); @row_ary = $dbh->selectrow_array($statement); $ary_ref = $dbh->selectrow_arrayref($statement); $hash_ref = $dbh->selectrow_hashref($statement);

DBI also allows you to prepared cached statements, and to repeatedly execute prepared statements using placeholders.

The code pasted above is from the documentation for DBI.


Dave