-
-
15 Sep 2003 12:08:46 UTC
- Distribution: Algorithm-GenerateSequence
- Module version: 0.02
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (674 / 0 / 0)
- Kwalitee
Bus factor: 0- 94.12% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (2.59KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Algorithm::GenerateSequence - a sequence generator
SYNOPSIS
my $gen = Algorithm::GenerateSequence->new( [qw( one two three )], [qw( hey bee )], ); print join(' ', $gen->next), "\n"; # one hey print join(' ', $gen->next), "\n"; # one bee print join(' ', $gen->next), "\n"; # two hey print join(' ', $gen->next), "\n"; # two bee ...
DESCRIPTION
Algorithm::GenerateSequence provides an iterator interface to a sequence you define in terms of the symbols to use in each position.
You may use a different amount of symbols in each position and the module will iterate over them correctly. This might be useful in identifying all the cards in a deck:
my $deck = Algorithm::GenerateSequence->new( [qw( Heart Diamond Spade Club )], [qw( A 2 3 4 5 6 7 8 9 10 J Q K )], );
Or for a range of addresses to scan:
my $scan = Algorithm::GenerateSequence->new( [192], [168], [0..254], [1] );
METHODS
new( @values );
@values contains arrays of symbols which will be used to form the sequence
next
returns a list containing the next value in the sequence, or false if at the end of the sequence
as_list
return the remainder of the sequence as a list of array references
BUGS
None currently known. If you find any please make use of http://rt.cpan.org by mailing your report to bug-Algorithm-GenerateSequence@rt.cpan.org, or contact me directly.
AUTHOR
Richard Clamp <richardc@unixbeard.net>
COPYRIGHT
Copyright (C) 2003 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Algorithm::GenerateSequence, copy and paste the appropriate command in to your terminal.
cpanm Algorithm::GenerateSequence
perl -MCPAN -e shell install Algorithm::GenerateSequence
For more information on module installation, please visit the detailed CPAN module installation guide.