$sth=$dbh->prepare("select whatever from thetable where col=?"); $sth->execute($val); my @list; while(my $hashref=$sth->fetchrow_hashref) { push @list,$hashref; } $sth->finish; return \@list; #### my $hashref=$dbh->getall_hashref("select * from abc where col=?",$val); my $arrayref=$dbh->getrow_arrayref("select * from abc where col=?",$val); etc...