in reply to Re^4: Elegance, dammit!
in thread Elegance, dammit!
But it would make more sense to me to just leave it as a hash of hashes; unless there are extreme efficiency issues to concern you, I prefer hashes over arrays when the values are different types of things (in this case, label and subject).my $ref = $dbh->selectall_hashref(... for my $row (values %$ref) { $row = [ @$row{qw/label subject/} ]; } # or # $_ = [ @$_{qw/label subject/} ] for values %$ref; # or # $ref = { map {; $_, [ @{$ref->{$_}}{qw/label subject/} ] } keys %$re +f };
|
|---|