#!perl -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; my $dbh = DBI->connect( 'dbi:ODBC:MyDB' , $user , $pass , {RaiseError=>1} ); my $sth = $dbh->prepare("SELECT * FROM foo"); $sth->execute; print CGI::header(); while (my $row = $sth->fetch){ my @r = map { defined $_ ? $_ : '' } @$row; print "@r
\n"; } $dbh->disconnect;