in reply to Dynamically create a foreach loop within a foreach loop?
Here's a recent question that covers effectively the same problem (except for an array-of-arrays instead of an array-of-hashes): Variable number of foreach loops
---Update:---
To summarize, the options seem to be:
- Using a recursive subroutine
- Using a loop that increments an array of indices (slow'ish, and probably awkward to adapt for the hash-of-hashes usecase)
- Using branching with if/elsif (not very elegant, and not exhaustive on its own)
- Using eval (some may consider it evil)
- Using mapm from the CPAN module List::MapMulti (convenient but slow)
- Using NestedLoops from the CPAN module Algorithm::Loops (convenient but slow)
In Section
Seekers of Perl Wisdom