Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: What should be returned in scalar context?

by simonm (Vicar)
on Dec 02, 2003 at 08:15 UTC ( [id://311553]=note: print w/replies, xml ) Need Help??


in reply to What should be returned in scalar context?

An interesting side-note: I've recently played around a bit with testing for null context (undefined wantarray), and using it to skip calculation of a return value. It's not a widely-used idiom, but I like it...

Replies are listed 'Best First'.
Re: Re: What should be returned in scalar context?
by Juerd (Abbot) on Dec 02, 2003 at 09:47 UTC

    null context

    It's called void context, not null context.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-18 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found