in reply to Generating combinatorial strings
If the lists may have different lengths, all you have to do is change the first argument to NestedLoops:use strict; use warnings; use 5.010; use Algorithm::Loops qw(NestedLoops); NestedLoops [([1..3]) x 5], sub { say @_ };
NestedLoops [[1..3], [1..5], [1..3]], sub { say @_ };
(use 5.010; is only required for say, not for NestedLoops).
tye++ for such a useful module.
|
|---|