while ((@cols)=$sth->fetchrow_array){ print OFILE join "$delimiter" => (@cols),"\n"; } #end while #### while ((@cols)=$sth->fetchrow_array||die("unable to print row $DBI::errstr\n")){ print OFILE join "$delimiter" => (@cols),"\n"; } #end while #### if ($DBI::errstr) {die("error $DBI::errstr\n");}