Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re3: variable set to 0 ? 0 : 1

by blakem (Monsignor)
on Sep 06, 2002 at 08:31 UTC ( [id://195596]=note: print w/replies, xml ) Need Help??


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

there's no substite for using wantarray to check your calling context
Interesting example, though I fail to see how wantarray will help in this case:
sub use_wantarray { return wantarray ? () : 0 }
Wont work properly in your example either.... Note that the above sub is equivalent* to the recommended way to return false, i.e. simply return:
sub recommended_way { return; }
* except when used in void context, but that isn't relevant here.

-Blake

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found