in reply to Pin code

You could use glob to generate the numbers and grep to filter out repeats.

johngg@shiraz:~/perl/Monks$ perl -Mstrict -Mwarnings -E ' my @notOnes = ( 0, 2 .. 9 ); my $globStr = ( q|{| . join( q{,}, @notOnes ) . q|}| ) x 3 . q{1}; say for grep { ! m{(.).*\1} } glob $globStr;' | wc -l 504

I hope this is helpful.

Update: Adding a line to show what the string passed to glob looks like.

johngg@shiraz:~/perl/Monks$ perl -Mstrict -Mwarnings -E ' my @notOnes = ( 0, 2 .. 9 ); my $globStr = ( q|{| . join( q{,}, @notOnes ) . q|}| ) x 3 . q{1}; warn qq{$globStr\n}; say for grep { ! m{(.).*\1} } glob $globStr;' | wc -l {0,2,3,4,5,6,7,8,9}{0,2,3,4,5,6,7,8,9}{0,2,3,4,5,6,7,8,9}1 504

Cheers,

JohnGG