Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Truth and Falsehood

by haukex (Archbishop)
on Aug 18, 2019 at 07:04 UTC ( [id://11104636]=note: print w/replies, xml ) Need Help??


in reply to Re: Truth and Falsehood
in thread Truth and Falsehood

I suppose one could use sub f { return (); } if (f()) {}, but that's a very bad practice. (A sub that's expected to return a scalar should do so even in list context.)

I agree that subs that are expected to return a scalar should do return undef because of the problems with my %hash = ( k => f() );, but there are also some good arguments against return undef in other cases - as you've said, there are exceptions.

I mostly mentioned it because the old section "Truth and Falsehood" mentioned it, although with an attempt to improve the wording, as you've suggested yourself in the past.

Update: I missed your ninja edits, but I hope I've cleared up your bafflement nonetheless. Please feel free to add any information you think is missing!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found