#!/usr/bin/perl use strict; use warnings; use DBI; use CGI; $ENV{ORACLE_HOME} = "/disk2/oracle/product/10.1.0/db_1"; #declare your ORACLE_HOME in the script... (not the problem here but it could become a problem later on) my $dbh = DBI->connect('dbi:Oracle:host=host.domain.tld;sid=SID;port=1521', 'USER', 'PASS', { RaiseError => 1, AutoCommit => 0 }); print "Content-type: text/html\n\n"; my $sth0 = $dbh->prepare("SELECT...") or die "Couldn't prepare 1st statement: " . $dbh->errstr; $sth0->execute; while (my @data = $sth0->fetchrow_array()) { my $column1 = $data[0]; my $column2 = $data[1]; square brackets here print $column1 . "\t" . $column2; } $sth0->finish; $dbh->disconnect;