# # either # my $employees_lol = $dbh->selectall_arrayref($query2); # # or # my $sth = $dbh->prepare($query2); $sth->execute(); my $employees_lol = $sth->fetchall_arrayref(); __END__ $employees_lol = [ [ '1', 'Fred', '5000' ], [ '2', 'Joshua', '5000' ], [ '3', 'Kim', '5600' ], [ '4', 'Dave', '6000' ], [ '5', 'Sal', '4500' ] ];