genesis['Foxtrot'][0]['instrumental'] = 'excellent' $gensis->{Foxtrot}[0]{instrumental} = 'excellent'; #### # takes prepared statement handle and returns LoH sub db2tmpl { my ($sth) = @_; $sth->execute; my $fields = $sth->{NAME}; my $rows = $sth->fetchall_arrayref; my @loh; for my $row (@$rows) { my %hash; @hash{@$fields} = @$row; push @loh, {%hash}; } return \@loh; }