Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I have a general question about foreach loops. Usually I like to loop through things with the perlish:
Occasionally I need to access the array element prior to the current one that I am on based on what I see in the current element. When this is the case, I will usually fall back to the c-style:
Which obviously does allow me to get to where I need to be. My question is, is there a way to access the index of the current element in a "perlish" foreach loop, so that I don't need to go the c-style way? I much prefer the cleaner interface on the perl way of doing things. Thanks!! In reply to Foreach Loops by hubb0r
|
|