note
Anonymous Monk
<p>
Here's one possible solution. No attempt was made to match the order in the generated sequence.
<c>
use Algorithm::Combinatorics qw( permutations );
my $iter = permutations( [split //, shift // q(how do you do)] );
while (my $p = $iter->next) {
print join q(), @$p, "\n";
}
</c></p>
<p>
See [mod://Algorithm::Combinatorics] for more info and examples.</p>
867478
1210657
6