$sth->execute(); my @all_rows; while ( my $ref = $sth->fetchrow_arrayref()) { # Needs to be de-referenced (Anonymous monk's fix) push(@all_rows, [@{$ref}]); } foreach my $row_ref (@all_rows) { print "$row_ref->[0]\n"; }