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

Re^2: variable set to 0 ? 0 : 1 (return by itself returns undef in scalar context)

by Flexx (Pilgrim)
on Sep 06, 2002 at 12:51 UTC ( [id://195628]=note: print w/replies, xml ) Need Help??


in reply to Re: variable set to 0 ? 0 : 1
in thread variable set to 0 ? 0 : 1

return 1 if $status == 0; return; # a return by itself implicitly returns an empty list

It's true that return by itself returns an empty list in list context. But it returns undef in scalar context -- not   scalar( () )! ;)

Updated: Simply added a quote of what I was refering to, since the thread grew quite long. Improved punctuation to boost readability. Removed unneccesary extra link to return.

Replies are listed 'Best First'.
Re^3: variable set to 0 ? 0 : 1
by Aristotle (Chancellor) on Sep 06, 2002 at 13:38 UTC
    Excellent catch; I updated my node.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found