my $sth = $dbh->prepare("select * from table"); $sth->execute(); while (my $res = $sth->fetchrow_arrayref()){ print "@$res"; }