Array::EachArray::Each can iterate over one or more arrays, returning one or more elements from each array followed by the array index. | |
Download |
Array::Each Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Brad Baxter
- Publisher web site:
- http://search.cpan.org/~bbaxter/Array-Each-0.02/Each.pm
Array::Each Tags
Array::Each Description
Array::Each can iterate over one or more arrays, returning one or more elements from each array followed by the array index. Array::Each can iterate over one or more arrays, returning one or more elements from each array followed by the array index.SYNOPSIS use Array::Each; # one array my @x = qw( a b c d e ); my $one = Array::Each->new( @x ); while( my( $x, $i ) = $one->each() ) { printf "=: %sn", $i, $x; } # multiple arrays my @y = ( 1,2,3,4,5 ); my $set = Array::Each->new( @x, @y ); while( my( $x, $y, $i ) = $set->each() ) { printf "=: %s %sn", $i, $x, $y; } # groups of elements (note set=> parm syntax) my @z = ( a=>1, b=>2, c=>3, d=>4, e=>5 ); my $hash_like = Array::Each->new( set=>, group=>2 ); while( my( $key, $val ) = $hash_like->each() ) { printf "%s => %sn", $key, $val; } Requirements: · Perl
Array::Each Related Software