 Welcome to the Monastery PerlMonks

### Re^6: list of four digit lock combinations without repeated digits

 on Jun 22, 2018 at 02:35 UTC ( #1217153=note: print w/replies, xml ) Need Help??

```time perl -MAlgorithm::Combinatorics=:all -wle'
my \$i=variations_with_repetition(["a".."z"],\$ARGV);
my @x; push @x, map {s/ //} qq[@\$_] while \$_=\$i->next;
print scalar @x' 4
```
```time perl -MAlgorithm::Combinatorics=:all -wle'
my \$i=variations_with_repetition(["a".."z"],\$ARGV);
my @x; push @x, map {\$_} qq[@\$_] while \$_=\$i->next;
print scalar @x' 4
```
```time perl -MAlgorithm::Combinatorics=:all -wle'
my \$i=variations_with_repetition(["a".."z"],\$ARGV);
my @x; push @x, pack "A*", qq[@\$_] while \$_=\$i->next;
print scalar @x' 4
```
```time perl -MAlgorithm::Combinatorics=:all -wle'
my \$i=variations_with_repetition(["a".."z"],\$ARGV);
my @x; push @x, join "", @\$_ while \$_=\$i->next;
print scalar @x' 4
```
```time perl -MAlgorithm::Combinatorics=:all -le'
my \$i=variations_with_repetition(["a".."z"],\$ARGV);
my @x; qq[\$"=undef]; push @x, qq[@\$_] while \$_=\$i->next;
print scalar @x' 4
```

Create A New User
Node Status?
node history
Node Type: note [id://1217153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?