time perl -MAlgorithm::Combinatorics=:all -le' my $i=variations_with_repetition(["a".."z"],$ARGV[0]); my @x; qq[$"=undef]; push @x, qq[@$_] while $_=$i->next; print scalar @x' 4