in reply to Searching hashes of hashes ...
You can't do what you want without looping, since every key needs to be visited. In fact, you need three loops.
for every company for every employee of the company for every family member of the company
But yes, you can use grep to loop.
my @companies = grep { grep { $_ eq 'jim' } @{$_->{EMPLOYEES}} && grep { $_ eq 'bill' } @{$_->{FAMILY_MEMBERS}} } keys %CompanyInfo;
|
|---|