Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
The stupid question is the question not asked
 
PerlMonks  

Re^4: "last expression" quiz

by robin (Chaplain)
on Oct 23, 2005 at 15:14 UTC ( #502314=note: print w/ replies, xml ) Need Help??


in reply to Re^3: "last expression" quiz
in thread "last expression" quiz

There is a bug in your code. You've missed out the ->() in the last two cases, so it's printing the sub rather than the result of calling the sub.


Comment on Re^4: "last expression" quiz
Re^5: "last expression" quiz
by Aristotle (Chancellor) on Oct 27, 2005 at 05:37 UTC

    Gack. Thanks for the catch. That was stupid. Fixed, node has been updated.

    The new behaviour is a tad more consistent, but still not consistent with the documentation. What gets returned is the last expression from the body of the do, while the last one evaluated is clearly the while/until condition. (Arguably, the real behaviour is more useful than the strictly doc-adherent one would be.)

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-04-20 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls