my $sth = $dbh->prepare( "SELECT * FROM $table LIMIT 0" ); $sth->execute(); my $columns = $sth->{NAME};