in reply to permutations of array

oops, spoke too soon. the cpan module and sample code generate permutations, I need combinations. I don't care about the order of the array elements.
@array=qw(big bad prog) --->
big
bad
prog
big bad
big prog
big bad prog

Replies are listed 'Best First'.
Re: Re: permutations of array
by I0 (Priest) on Feb 22, 2002 at 06:18 UTC
    #Yet another way to do it
    sub combinations{ return map{my $i=$_<<1;[grep{($i>>=1)&1}@_]}0..(1<<@_)-1 }