-
-
30 Aug 2017 23:32:39 UTC
- Distribution: Math-Permute-Lists
- Module version: 20170828
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (381 / 0 / 41)
- Kwalitee
Bus factor: 1- 98.84% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (5.44KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Carp
- Test::More
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
Name
Math::Permute::Lists - Generate all the permutations of zero or more nested lists.
Synopsis
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
Description
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()
is 100% Pure Perl.Export
The
permute()
function is exported.Installation
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
Author
PhilipRBrenan@appaapps.com
http://www.appaapps.com
Acknowledgements
From a suggestion by Philipp Rumpf.
See Also
- Math::Cartesian::Product
- Math::Disarrange::List
- Math::Permute::List
- Math::Subsets::List
- Algorithm::Permute
- Algorithm::FastPermute
Copyright
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.
Module Install Instructions
To install Math::Permute::Lists, copy and paste the appropriate command in to your terminal.
cpanm Math::Permute::Lists
perl -MCPAN -e shell install Math::Permute::Lists
For more information on module installation, please visit the detailed CPAN module installation guide.