Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^8: Interview Prepration

by merlyn (Sage)
on Apr 04, 2005 at 18:44 UTC ( #444760=note: print w/replies, xml ) Need Help??

in reply to Re^7: Interview Prepration
in thread Interview Prepration

Can we both agree on this:

In Perl, the keywords "for" and "foreach" are identical. In many other languages, the two words stand for two different kinds of loops

No, only if you change that to "many languages, including Perl".

perlsyn has a heading called "for loops", and a heading called "foreach loops". I'm going to quote that as an authority, as it was written by the only authority who really matters. Therefore, Perl has for loops, and foreach loops, and overlapping keywords. "for" and "foreach" are not the same in that sentence.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^9: Interview Prepration
by jZed (Prior) on Apr 04, 2005 at 18:51 UTC
    Ok, how about:

    In Perl, the keywords "for" and "foreach" are identical. In many other languages the two keywords refer to two different loop structures. Perl supports both loop structures, but allows the use of either keyword for either structure.

      Many other languages? Could you name a few that actually have the keywords 'for' and 'foreach', and refer to two different loop structures?

        Not sure how different they are... I'm just being argumentative of course :)
        "But what of all those sweet words you spoke in private?"
        "Oh that's just what we call pillow talk, baby, that's all."

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-10-03 22:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found