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