We don't bite newbies here... much | |
PerlMonks |
Re: Keeping a Count in foreachby mfriedman (Monk) |
on Jun 17, 2002 at 18:03 UTC ( [id://175148]=note: print w/replies, xml ) | Need Help?? |
Can I do this using the foreach structure easily or will I have to resort to a for loop? There is no real difference between for and foreach, except for convention. From perlsyn:
The foreach keyword is actually a synonym for the for keyword, so you can use foreach for readability or for for brevity. So,
Are exactly the same, as are
In Section
Seekers of Perl Wisdom
|
|