more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
hello there.
i need some help here. what im trying to do is to list out combinations of a given array of strings, numbers, etc. for example: if i had an array like qw(a b c), i would like to generate combinations of the array above, so that i would have: qw(a b c), qw(a c b), qw(b a c), qw(b c a), qw(c a b), and qw(c b a) is there a way, in Perl, to come up with the result above? please help. thanx. ps: to find out how many different combinations can be produced from an array of n elements, use factorial (!). for example, if i had an array of 5 elements, my combinations will have a total of 5! = 5x4x3x2x1 = 120 different combinations In reply to generate combinations of lists by gpm1982
|
|