Array - complete object-oriented array class
use Class::Maker::Examples::Array; Array->new( array => [1..100] ); # standard $a->shift; $a->push( qw/ 1 2 3 4 / ); $a->pop; $a->unshift( qw/ 5 6 7 / ); $a->reset; $a->join( ', ' ); # extended $a->count; $a->get; $a->pick( 4 ); $a->union( 100..500 ); $a->intersection( 50..100 ); $a->difference( 50..100 );
This an object-oriented array class, which uses a method-oriented interface.
Mostly they have the similar syntax as the native perl functions (use "perldoc -f"). If not they are documented below, otherwise a simple example is given.
Returns the number of elements (same as @arry in scalar context).
Resets the array to an empty array.
Returns the backend array.
Returns every 'step' (default: 2) element.
Returns the union of two arrays (Array object is returned).
Returns the intersection of the two arrays (Array object is returned).
Returns the difference of the two arrays (Array object is returned).
None by default.
Because most methods return Array objects itself, the can be easily further treated with Array methods. Here a rather useless, but informative example.
use Class::Maker::Examples::Array;
my $a = Array->new( array => [1..100] ); my $b = Array->new( array => [50..100] ); $a->intersection( $b )->pick( 4 )->join( ', ' );
Murat Uenalan, muenalan@cpan.org
perl, perlfunc, perlvar
To install Auth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Auth
CPAN shell
perl -MCPAN -e shell install Auth
For more information on module installation, please visit the detailed CPAN module installation guide.