my $res = $dbh->selectall_arrayref("select post_author, post_date from wp_posts"); foreach (@$res){ print "@$_\n"; }