for my $i(sort @tables) { print uc $i . "\n\n"; ## get a list of columns for the table my $sth = $dbh->prepare("LISTFIELDS $i"); $sth->execute; my $row = $sth->fetchrow_hashref(); for my $header(keys %{$row}) { print " $header\n"; } $sth->finish; sleep 1; }