my $sth=$dbh->prepare("SELECT * FROM table_name LIMIT 1")... my @column_names = @{$sth->{NAME}};