Math::Permute::Lists - Generate all the permutations of zero or more nested lists.
use Math::Permute::Lists; permute {say "@_"} [1,2],[3,4]; # 1 2 3 4 # 1 2 4 3 # 2 1 3 4 # 2 1 4 3 # 3 4 1 2 # 3 4 2 1 # 4 3 1 2 # 4 3 2 1 permute {say "@_"} 1,[2,[3,4]]; # 1 2 3 4 # 1 2 4 3 # 1 3 4 2 # 1 4 3 2 # 2 3 4 1 # 2 4 3 1 # 3 4 2 1 # 4 3 2 1
Generate all the permutations of zero or more nested lists using the standard Perl metaphor.
permute() returns the number of permutations in both scalar and array context.
permute()
permute() is 100% Pure Perl.
The permute() function is exported.
Standard Module::Build process for building and installing modules:
perl Build.PL ./Build ./Build test ./Build install
Or, if you're on a platform (like DOS or Windows) that doesn't require the "./" notation, you can do this:
perl Build.PL Build Build test Build install
PhilipRBrenan@appaapps.com
http://www.appaapps.com
From a suggestion by Philipp Rumpf.
Copyright (c) 2009 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Math::Permute::Lists, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Permute::Lists
CPAN shell
perl -MCPAN -e shell install Math::Permute::Lists
For more information on module installation, please visit the detailed CPAN module installation guide.