#untested my $matrix_ref = $dbh->selectall_arrayref(' SELECT some_col FROM table1 INNER JOIN table2 ON table1.fruit_id = table2.fruit_id WHERE table1.fruit = ? ', undef, 'apple'); #### [ [a1], [a2], [a3] ]