Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

for != foreach

by Util (Priest)
on Jun 18, 2002 at 03:14 UTC ( [id://175256]=note: print w/replies, xml ) Need Help??


in reply to Re: Keeping a Count in foreach
in thread Keeping a Count in foreach

Yes, but the first two are completely different from the last two. We have to call these control structures *something*. When talking about them, we call the first two "foreach loops", and the last two "for loops", regardless of which keyword is used. perlsyn follows this convention in its =head2 headers, and arunhorne is using it in his question.
$ perl -MO=Deparse,p -e 'for(@z){print}' foreach $_ (@z) { print $_; } -e syntax OK

Replies are listed 'Best First'.
•Re: for != foreach
by merlyn (Sage) on Jun 18, 2002 at 03:21 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://175256]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found