On Mon, May 25, 2009 at 03:16, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote: > sanket vaidya wrote: >> >> What is the difference between the 'for' & 'foreach' loops? I know that >> they >> can be used interchangeably then what is the purpose of keeping them >> separate? > > The _words_ 'for' and 'foreach' can be used interchangeably in foreach > loops, but a true for loop is something else. snip
Bullpucky, the for loop as an iterator has as long (or longer) of a history than the c-style INIT-TEST-MUTATE. Also, you might as well get used to using for as an iterator loop now, because in Perl 6 there is no foreach loop. And the c-style loop is named loop. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/