Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: getting iteration number inside iteration loop

by ferreira (Chaplain)
on Jun 29, 2007 at 14:47 UTC ( [id://624095]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use List::MoreUtils qw( each_arrayref );
    
    ...
    while ( my ($idx, $v) = $each->() ) {
        print "$idx: $v\n";
    }
    
  2. or download this
    use List::MoreUtils qw( each_array );
    
    ...
        my $idx = $each->('index');
        print "$idx: $v\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://624095]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found