Don't know of a module, but if you are just looking at strings, the following code would work, printing each generated possibility only once:
#
# Assumes $word and $desired_length previously defined.
#
my @characters = split('', $word);
my (%found);
&gen_nofm(\@characters, \%found, '', $desired_length);
print($_, "\n")
foreach (sort({lc($a) cmp lc($b)} keys(%found)));
sub gen_nofm
{
my ($charlist,
$found_thusly,
$partial_word,
$desired_length) = @_;
if ($desired_length)
{
for (my $index = 0;
$index < scalar(@{$charlist});
$index++)
{
&gen_nofm($charlist,
$found_thusly,
$partial_word . ${$charlist}[$index],
$desired_length - 1);
}
}
else
{
${$found_thusly}{$partial_word}++;
}
}