if ( $type eq 'array' ) {
while ( my $row = $sth->fetchrow_arrayref() ) {
push @result, [@{$row}];
}
} else {
while ( my $row = $sth->fetchrow_hashref() ) {
push @result, $row;
}
}
Where $type is defined as to whether you want to return an array containing records with a list of field values, or an array containing records with a hash of field name to value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.