in reply to Using a better database fetch
You can reduce
Tomy $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;
Where the return is optional as well.return $self->dbh->selectall_arrayref($sql, { Slice => {} });
|
---|
In Section
Seekers of Perl Wisdom