GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  LIST::PERMUTOR (3)

.ds Aq ’

NAME

List::Permutor - Process all possible permutations of a list

CONTENTS

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>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PERMUTOR (3) 1999-06-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.