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

Re^7: Interview Prepration

by jZed (Prior)
on Apr 04, 2005 at 18:17 UTC ( [id://444754]=note: print w/replies, xml ) Need Help??


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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^8: Interview Prepration
by RazorbladeBidet (Friar) on Apr 04, 2005 at 18:38 UTC
    (Downvoted because):

    It's not meaningless when the perldocs refer to For Loops and Foreach Loops. They also mention that
    The foreach keyword is actually a synonym for the for keyword, so you can use foreach for readability or for for brevity. (Or because the Bourne shell is more familiar to you than csh, so writing for comes more naturally.)
    So the correct response to : "What is the difference between for and foreach?" is "The keywords or the loop structures?"

    It's an English problem.
    --------------
    "But what of all those sweet words you spoke in private?"
    "Oh that's just what we call pillow talk, baby, that's all."
      You're right. Thanks for downvoting me, I deserved it.
        Not downvoting you, just the post. I have a lot of respect for many people on here, you (highly) included. People often say explanations should be given with downvotes. There's mine :)
        --------------
        "But what of all those sweet words you spoke in private?"
        "Oh that's just what we call pillow talk, baby, that's all."
Re^8: Interview Prepration
by merlyn (Sage) on Apr 04, 2005 at 18:44 UTC
    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.

      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?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found