in reply to Perl::DBI - return column header
Use either fetchrow_hashref or selectrow_hashref and extract the keys.
my $hashref = $sqlexe->fetchrow_hashref(); my @column_names = keys %$hashref;
My vote is for the NAME attribute of the statement handle (next reply). Thanks, pfaut.
If, like me, you've been indoctrinated into thinking that a class's interface should consist solely of methods, you'll miss a lot of good stuff that DBI makes available in the form of attributes.
|
|---|