my $dbh = DBI->connect($data_source, $username, $auth, {RaiseError => 1}); my $sth = $dbh->prepare('select * from table'); print qq~\n\n~; print map "\n", @{$sth->{NAME}}; print "\n"; while (my $arrayref = $sth->fetchrow_arrayref) {  print "\n";  print map "\n", map +(defined($_) ? $_ : 'NULL'), @$arrayref;  print "\n"; } print "
$_
$_
\n"; $sth->finish; $dbh->disconnect;