Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Interview Prepration

by Anonymous Monk
on Apr 04, 2005 at 07:43 UTC ( #444597=note: print w/replies, xml ) Need Help??


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

Uh, yes. The words for & foreach are an alias to each other.

Replies are listed 'Best First'.
Re^4: Interview Prepration
by merlyn (Sage) on Apr 04, 2005 at 17:28 UTC
    Right. They're syntax aliases, but they're semantically entirely different things. Did you read what I quoted? It explains what I mean, and I don't want to keep retyping that.

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

      To quote:

      They're definitely two different kinds of loops. However the text for and foreach may be used to introduce either one. The actual loop-style is determined by what follows.
      Which, seems to me, answers the question:
      What is the difference between for & foreach, exec & system
      as "for & foreach are aliases - there is no difference. They both introduce either a for-style loop or a foreach-style loop, determined by what follows."

      Methinks you're getting a bit bent out of shape over someone agreeing with you. Either that, or I'm completely missing your point.

        It's a language (English) problem - for and foreach are words but they also designate the style of the loop, which I think is what merlyn is getting at.

        The words are aliases, the loops are not, as they are taken in context. It sounded like the disagreement was over:
        for & foreach are now an alias to each other
        which is ambiguous
        --------------
        "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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2020-10-24 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (242 votes). Check out past polls.

    Notices?