List::Enumerate - Provides list enumeration
version 0.005
Provides a simple means of list enumeration.
my @list = qw(Larry Moe Curly); for my $name ( enumerate(@list) ) { print $name->index, " ", $name->item, "\n"; }
Instead of
my @list = qw(Larry Moe Curly); my $index = 0; for my $name ( @list ) { print $index, " ", $name, "\n"; $index++; }
Returns a list of List::Enumerate objects when called with a list
List::Enumerate call, returns the index position
List::Enumerate call, returns the item
Constructor for List::Enumerate, used internally
James Spurin <spurin@cpan.org>
This software is copyright (c) 2014 by James Spurin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install List::Enumerate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm List::Enumerate
CPAN shell
perl -MCPAN -e shell install List::Enumerate
For more information on module installation, please visit the detailed CPAN module installation guide.