#!/usr/bin/perl use strict; use warnings; my %pets; my $color; $color="black"; $pets{$color}=\[]; push @${$pets{$color}},"cat"; push @${$pets{$color}},"dog"; $color="while"; $pets{$color}=\[]; push @${$pets{$color}},"rat"; push @${$pets{$color}},"bat"; foreach my $p (values %pets) { print "$p\n"; #^^^this is ref to ref to array? print "$$p\n"; #^^^this is ref to array print "@$$p\n\n"; #^^^this is array } #### push @${$pets{$color}},"rat"; REF(0x815c4d0) ARRAY(0x815c4e8) rat bat REF(0x812ed0c) ARRAY(0x812ed48) cat dog