Algorithm::Combinatorics is good for this (though it sometimes takes trial and error to work out which of it algorithms you need), and it generates these kinds of patterns very efficiently:
#! perl -slw use strict; use Algorithm::Combinatorics qw[:all]; my $iter = combinations( [0..9], 4 ); print "@$_" while $_ = $iter->next; __END__ C:\test>4of10Combinations.pl | wc -l 210
In reply to Re: list of four digit lock combinations without repeated digits
by BrowserUk
in thread list of four digit lock combinations without repeated digits
by Lotus1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |