Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: how can i get the index value of array during runtime

by Samy_rio (Vicar)
on Mar 02, 2007 at 10:16 UTC ( [id://602851]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
     while( my( $x, $i ) = $one->each() ) {
         printf "%3d: %s\n", $i, $x;
     }
    
  2. or download this
    use strict;
    use warnings;
    ...
    for my $index (0..$#x){
        print "$index : $x[$index]\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found