all possible combinations of the number 1..n
use Algorithm::Combinatorics qw[ combinations ];; for my $k ( 1 .. 3 ) { my $i = combinations( [ 1..3 ], $k ); print @$_ while defined( $_ = $i->next ); };; 1 2 3 1 2 1 3 2 3 1 2 3
In reply to Re: All possible number combinations in perl
by BrowserUk
in thread All possible number combinations in perl
by austinj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |