azaria has asked for the wisdom of the Perl Monks concerning the following question:
I would like to generates simply (without for loops) the all permutation strings (5 x 9 x 2 x 6 options)@a1 = qw(0 1 2 3 4); @a2 = qw(0 1 2 3 4 5 6 7 8); @a3 = qw(0 1); @a4 = qw(0 1 2 3 4 5);
Any simple solution ? Thanks azaria$str = $a1[$i] . " " . $a2[$j] . " ". $a3[$k]. " " . $a4[$l]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array combinations
by moritz (Cardinal) on Jun 26, 2008 at 10:18 UTC | |
|
Re: array combinations
by BrowserUk (Patriarch) on Jun 26, 2008 at 13:46 UTC | |
|
Re: array combinations
by dragonchild (Archbishop) on Jun 26, 2008 at 12:05 UTC | |
|
Re: array combinations
by linuxer (Curate) on Jul 01, 2008 at 18:41 UTC |