in reply to Re^2: All possible number combinations in perl
in thread All possible number combinations in perl
That isn't all the combinations:
[0] Perl> for $k ( 1 .. 5 ) { $i = combinations( [ 1..5 ], $k ); print + @$_ while defined( $_ = $i->next ) };; 1 2 3 4 5 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 1 2 3 1 2 4 1 2 5 1 3 4 1 3 5 1 4 5 2 3 4 2 3 5 2 4 5 3 4 5 1 2 3 4 1 2 3 5 1 2 4 5 1 3 4 5 2 3 4 5 1 2 3 4 5
It may be what you want, but if it is, then you aren't after combinations.
|
|---|