in reply to Hash of arrays

Having fixed your syntax error (missing brace) and done what's needed to make it work happily with strict and warnings, it does exactly what you expect:
use strict; use warnings; my %test; for my $i (1..3) { push(@{$test{obj1}{values}},$i); } for my $i (4..6) { push(@{$test{obj2}{values}},$i); } foreach my $key (keys %test) { foreach my $tmpvalue (@{$test{$key}{values}}) { print "$key --> $tmpvalue\n"; } }

Caution: Contents may have been coded under pressure.