good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Using foreach to iterate through a hash in an arrayby choroba (Cardinal) |
on Aug 30, 2017 at 11:28 UTC ( [id://1198327]=note: print w/replies, xml ) | Need Help?? |
my @bla = (%hash, %hash2); doesn't create an array of hashes, it flattens the hashes to key - value pairs, so @bla in fact contains
etc. (in no particular order). To create an array of hashes, use references:
You can then iterate with dereference
or, in recent Perls,
In Section
Seekers of Perl Wisdom
|
|