use DBI; my $dbh = DBI->connect("dbi:ODBC:PRDB") || die "Can't connect to $data_source: $DBI::errstr"; my $sth = $dbh->prepare( q{SELECT * FROM $table}) || die "Can't prepare statement: $DBI::errstr"; my $rc = $sth->execute(); @test = $sth->fetchrow_array; .....Some display section here. $dbh->disconnect;