note
chunlou
Silly me. Should have consulted with this: [id://24270].
<code>
use Algorithm::FastPermute;
sub combinations {
return [] unless @_;
my $first = shift;
my @rest = combinations(@_);
return @rest, map { [$first, @$_] } @rest;
}
for(combinations('a'..'c')){
my @c = @{$_};
permute {print @c , "\n"} @c;
}
__END__
c
b
bc
cb
a
ac
ca
ab
ba
abc
acb
cab
bac
bca
cba
</code>
285933
285960