Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^9: Can you explain the result?

by Lotus1 (Curate)
on Dec 06, 2011 at 17:43 UTC ( #942069=note: print w/replies, xml ) Need Help??

in reply to Re^8: Can you explain the result?
in thread Can you explain the result?

There are also goto, next, last.

In the context of the vague assertion I was replying to there is no difference in my opinion. When 'return' is called it does it's job just as when 'open' is called. The difference the OP doesn't seem to grasp is that when return is called, anything after it in that block doesn't execute (how could it?) This is by design and is how other languages work.

Replies are listed 'Best First'.
Re^10: Can you explain the result?
by Corion (Pope) on Dec 06, 2011 at 17:57 UTC

    Sure, but all of these four are keywords, and not functions - this is what makes them special.

    But in the context of parsing, they are not really treated that special from (prototyped) functions, so there is no difference in that sense. Well - I'm not sure whether it's possible to pass a label to a function. My naive approach doesn't pass strict:

    use strict; sub bar($) { print shift }; FOO: { bar FOO; };

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942069]
[zentara]: TGIF, I'm blowing my mind watching Casimir Effect & Black Holes - Sixty Symbols I love 60 Symbols. :-)
zentara ..oO the vacuum is teeming with photons and micro-blackholes
zentara .. and probably NSA bugs ;-)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-06-23 16:12 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (552 votes). Check out past polls.