Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^6: What could make "()" a good value for boolean false?

by ikegami (Patriarch)
on Apr 01, 2016 at 15:55 UTC ( [id://1159291]=note: print w/replies, xml ) Need Help??


in reply to Re^5: What could make "()" a good value for boolean false?
in thread What could make "()" a good value for boolean false?

That doesn't check if () is true or false. Change it to ($x) or @a and you'll get exactly the same result. That check if = is true or false, which check the number of elements on the **RHS** of =.

That passage is poorly worded, leading to people like you quoting it as it says something other than it says. When it says (), when it says "()", it's actually referring to "the value returned by () in scalar context, which is the same thing as saying undef. () is not a value. It shouldn't list one of the many many operator that can return something false in scalar context.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2025-12-13 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (93 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.