in reply to Perl program to generate a descending order of 9-unique digit numbers

use Algorithm::Combinatorics:

use Algorithm::Combinatorics qw[ permutations ]; my $iter = permutations( [ reverse 0 .. 9 ] ); print join '', @$_ while defined( $_ = $iter->next ); 9876543210 9876543201 9876543120 9876543102 9876543021 9876543012 9876542310 9876542301 9876542130 9876542103 9876542031 9876542013 9876541320 ...

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Perl program to generate a descending order of 9-unique digit numbers
  • Download Code

Replies are listed 'Best First'.
Re^2: Perl program to generate a descending order of 9-unique digit numbers
by Anonymous Monk on Apr 27, 2016 at 15:59 UTC

    If 0 is included in digits, one can use variations.

    $ perl -MAlgorithm::Combinatorics=:all -le 'print @$_ for variations [reverse 0..9], 9;'