Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Truth and Falsehood

by ikegami (Patriarch)
on Aug 30, 2019 at 16:31 UTC ( [id://11105313]=note: print w/replies, xml ) Need Help??


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

That makes no sense. An empty list isn't false. Or true. It's not a scalar, so those concepts don't apply to it. You can't evaluate whether an empty list is true or false. You can only evaluate if a scalar is true or false.

As such, if you're trying to get a true or false value from those operators, you would be evaluating them in scalar context, and the following is what the listed operators actually return in scalar context:

  • grep returns the count of matching elements.
  • map returns the count of elements it would return.
  • m// and s/// return success or not.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-03-29 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found