in reply to nested loops

algorithm permute, algorithm loops, loops -> http://search.cpan.org/~tyemq/Algorithm-Loops-1.031/lib/Algorithm/Loops.pm#NestedLoops Simulate foreach loops nested arbitrarily deep.