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)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dynamically create a foreach loop within a foreach loop?
by jdlev (Scribe) on Dec 11, 2013 at 11:52 UTC | |
by smls (Friar) on Dec 11, 2013 at 12:22 UTC |
In Section
Seekers of Perl Wisdom