You should always post the full example code.
Not sure what you are doing, but you are probably mixing arrays and arrays of refs and / or hashes and hashrefs. I usually use only links, since I like the syntax better and I like to be consistent:
use strict; use warnings; my($arrayrefOfHashrefs) = [ {foo => 'bar', bar => 'baz'}, {Hello => 'world'}, ]; foreach my $href (@$arrayrefOfHashrefs) { print join("\n", keys %$href); print "\n\n"; }
will print:
C:\Temp>perl foo.pl bar foo Hello
source share