my $sth = $dbh->prepare( $sql ); $sth->execute; my ($pointer); my $rv = $sth->bind_columns(\$pointer); while ($sth->fetch) { # do something with $pointer }