in reply to array of hashes

Your code is difficult to understand because it was not wrapped in "code" tags. Please modify your node to add code tags (see Writeup Formatting Tips).

Next, please use warnings; use strict;, then clean up any errors and warnings.

That being said, I tried using perltidy to clean up your code the best I could, and I still got an error:

Can't call method "0" on unblessed reference

How many children do you expect in your code? 1?

my $cnt = 0; for (keys %barry) {$cnt++ if $_ eq 'children'} print "cnt=$cnt\n"; __END__ cnt=1