AI::MicroStructure::List - Base class for simple lists of names
package AI::MicroStructure::beatles; use AI::MicroStructure::List; our @ISA = ( AI::MicroStructure::List ); __PACKAGE__->init(); 1; =head1 NAME AI::MicroStructure::beatles - The fab four structure =head1 DESCRIPTION Ladies and gentlemen, I<The Beatles>. I<(hysteric cries)> =cut __DATA__ # names john paul george ringo
AI::MicroStructure::List is the base class for all structures that are meant to return a random excerpt from a predefined list.
AI::MicroStructure::List
AI::MicroStructure::List offers several methods, so that the subclasses are easy to write (see full example in SYNOPSIS):
The constructor of a single instance. An instance will not repeat items until the list is exhausted.
init() must be called when the subclass is loaded, so as to read the __DATA__ section and fully initialise it.
Return $count names (default: 1).
1
Using 0 will return the whole list in list context, and the size of the list in scalar context.
0
Return the structure name.
Philippe 'BooK' Bruhat, <book@cpan.org>
<book@cpan.org>
Copyright 2005-2012 Philippe 'BooK' Bruhat, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install AI::MicroStructure, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::MicroStructure
CPAN shell
perl -MCPAN -e shell install AI::MicroStructure
For more information on module installation, please visit the detailed CPAN module installation guide.