# untested package DBIx::Simple::Result::Metaperl; our @ISA = qw(DBIx::Simple::Result); sub map_arrays_of_hashes { my ($self, $column_name) = @_; my %arrays; for my $row ($self->hashes) { push @{ $arrays{$row->{id}} }, $row; } return wantarray ? %arrays : \%arrays; } ... $db->result_class = 'DBIx::Simple::Result::Metaperl'; my %arrays_of_hashes = $db->query(...)->map_arrays_of_hashes('id');