Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: for, foreach: any difference?by Limbic~Region (Chancellor) |
on Apr 02, 2004 at 17:20 UTC ( [id://342039]=note: print w/replies, xml ) | Need Help?? |
MUBA,
Ok - yes and no - depends on how you look at it. One is usually referred to as a C-style for loop (does not localize $_ or implicitly alias looping variable) and the other is typically referred to as a foreach loop (which does both of those things). In your code, it does not matter which name you use. It is the looping construct that follows the name that determines the internal behavior. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|