http://www.perlmonks.org?node_id=1013746


in reply to Using a better database fetch

You can reduce
my $sth = $self->dbh->prepare($sql); $sth->execute(); my $rs = $sth->fetchall_arrayref( { user_id => 1, username => 1, first_name => 1, last_name => 1 } ); return $rs;
To
return $self->dbh->selectall_arrayref($sql, { Slice => {} });
Where the return is optional as well.