my $sth = $dbh->prepare ("select * from foo"); $sth->execute; while (my $ref = $sth->fetch) { print $ref->[0], "\n"; } # No need for $sth->finish;