perl -MBenchmark=:all -MAlgorithm::Combinatorics=:all -wle' for ("1".."4") { my $t0 = Benchmark->new; my $i = variations_with_repetition(["a".."z"],$ARGV[0]); my @x; push @x, pack "A*", qq[@$_] while $_=$i->next; my $t1 = Benchmark->new; my $ts = timestr(timediff($t1,$t0)); print $ts }' 4