Reputation: 11098
I have used:
my @ar = $stm->fetchrow_array
#to remove undefined
@ar = grep defined, @ar;
But that does not show the column name as reference
So I used
my $rec = $stm->fetchrow_arrayref
But it is difficult to remove undefined values and the array refernce is not the column names.
Upvotes: 0
Views: 167
Reputation: 385897
my $rec = $stm->fetchrow_hashref;
my @to_delete = grep { !defined($rec->{$_}) } keys %$rec;
delete @{$rec}{@to_delete};
Upvotes: 2