Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Index of Items in Array using foreach loop

by tmharish (Friar)
on Feb 22, 2013 at 10:48 UTC ( #1020130=note: print w/replies, xml ) Need Help??


in reply to Index of Items in Array using foreach loop

Yes - use the for loop:

for( my $Arrayindex = 0; $Arrayindex <= ( $#SampleArray ); $Arrayindex +++ ) { print $SampleArray[ $Arrayindex ] , ' is at location ' , $Arr +ayindex , ' in the array' , "\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020130]
help
Chatterbox?
[marioroy]: Wow. It's cool seeing Github coments "Update Monster.pm, Create Wild_hairs, Create alternate- PurpleOnGreen..., Then a location, Create Aleenia. Amazing, really. Thank you for sharing.
Discipulus when naming is clear and you know how to arrange the data, then coding it is a mere writing work
[Lady_Aleena]: marioroy, welcome to my insanity. 8)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-05-29 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?