Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Hope a subroutine will return undef by default

by wjw (Curate)
on Feb 11, 2014 at 16:33 UTC ( #1074439=note: print w/ replies, xml ) Need Help??


in reply to Hope a subroutine will return undef by default

Interesting question... will have to try this out.

call_sub; my $what_do_I_get = sub { return undefined; }

From The Docs

...You can omit the EXPR, in which case nothing is undefined, but you still get an undefined value that you could, for instance, return from a subroutine, assign to a variable, or pass as a parameter. ...

Not sure if one could make that the default though..?!?

...the majority is always wrong, and always the last to know about it...
Insanity: Doing the same thing over and over again and expecting different results.


Comment on Re: Hope a subroutine will return undef by default
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2015-07-07 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls