my $select = $dbh->prepare("select path from application_table where number = ? ORDER BY some_other_number"); $select->execute($number); my $array_ref = $select->fetchall_arrayref(); foreach my $row (@$array_ref) { foreach (@$row) { print "path: $_\n"; } } #### my $select = $dbh->prepare("select path from application_table where number = ? ORDER BY some_other_number"); $select->execute($number); my $array_ref = $select->fetchall_arrayref(); while(my($path) = $select->fetchrow_array) { print "PATH: $path\n"; }