-
-
06 Jun 1999 18:47:07 UTC
- Distribution: List-Permutor
- Module version: 0.022
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers (1223 / 0 / 0)
- Kwalitee
Bus factor: 0- 100.00% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (2.63KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
List::Permutor - Process all possible permutations of a list
SYNOPSIS
use List::Permutor; my $perm = new List::Permutor qw/ fred barney betty /; while (my @set = $perm->next) { print "One order is @set.\n"; }
DESCRIPTION
Make the object by passing a list of the objects to be permuted. Each time that next() is called, another permutation will be returned. When there are no more, it returns the empty list.
METHODS
- new LIST
-
Returns a permutor for the given items.
- next
-
Returns a list of the items in the next permutation. Permutations are returned "in order". That is, the permutations of (1..5) will be sorted numerically: The first is (1, 2, 3, 4, 5) and the last is (5, 4, 3, 2, 1).
- peek
-
Returns the list of items which would be returned by next(), but doesn't advance the sequence. Could be useful if you wished to skip over just a few unwanted permutations.
- reset
-
Resets the iterator to the start. May be used at any time, whether the entire set has been produced or not. Has no useful return value.
AUTHOR
Tom Phoenix <rootbeer@redcat.com>
Module Install Instructions
To install List::Permutor, copy and paste the appropriate command in to your terminal.
cpanm List::Permutor
perl -MCPAN -e shell install List::Permutor
For more information on module installation, please visit the detailed CPAN module installation guide.