Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Hope a subroutine will return undef by default

by wjw (Deacon)
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 pondering the Monastery: (6)
As of 2014-08-30 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls