# # either # my %employees_h2 = map { $_->[0], [ $_->[1], $_->[2] ]} @{$dbh->selectall_arrayref($query2)}; # # or # my %employees_h2 = map { shift @$_, [ @$_ ]} @{$dbh->selectall_arrayref($query2)}; __END__ %employees_h2 = ( '1' => [ 'Fred', '5000' ], '2' => [ 'Joshua', '5000' ], '3' => [ 'Kim', '5600' ], '4' => [ 'Dave', '6000' ], '5' => [ 'Sal', '4500' ] );