Ziggy pointed me towards a kata for today, by Norman Walsh. He wants to count the permutations of the middle letters in "morning".
I decided to use a module by Tom Phoenix:
use List::Permutor;
my $p = List::Permutor->new( split//, 'ornin' );
while( my @s = $p->next )
{
$hash{ join '', 'm', @s, 'g' }++;
}
$, = "\n";
print keys %hash;
Permuting by hand (Score:2)
get count analytically (Score:2)