I suggest you use List::Permutor:
use List::Permutor;
my $permutor = List::Permutor->new( 0, 1, 2);
while ( my @permutation = $permutor->next() ) {
print "@permutation\n";
}
More Related Contents:
- Difference of Two Arrays Using Perl
- How do I remove duplicate items from an array in Perl?
- How do you efficiently generate a list of K non-repeating integers between 0 and an upper bound N [duplicate]
- How can I check if a Perl array contains a particular value?
- Print all permutation in lexicographic order
- Finding all permutations of array elements as concatenated strings
- In Perl, how can I find the index of a given value in an array?
- How can I verify that a value is present in an array (list) in Perl?
- Algorithm to apply permutation in constant memory space
- How do I print unique elements in Perl array?
- search using perl one liner within a file [closed]
- How to re-direct the contents to a file instead of printing it to terminal
- Finding target sum of two numbers in array
- Easy interview question got harder: given numbers 1..100, find the missing number(s) given exactly k are missing
- Algorithm for finding numerical permutation given lexicographic index
- Getting STDOUT, STDERR, and response code from external *nix command in perl
- Iterating hash based on the insertion order?
- Algorithm to list unique permutations of string with duplicate letters
- Sieve of Eratosthenes algorithm in JavaScript running endless for large number
- What’s broken about exceptions in Perl?
- Delete ClearCase Views Script
- How to pass a variable from a child process (fork by Parallel::ForkManager)?
- What’s the difference between single and double quotes in Perl?
- Perl subroutine arguments
- Sort an array according to the elements of another array
- What does the function declaration “sub function($$)” mean?
- Which cpan installer is the right one? (CPAN.pm/CPANPLUS/cpanminus)
- How do I lock a file in Perl?
- Finding out the duplicate element in an array
- Why is the Switch module deprecated in Perl?