Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Hope a subroutine will return undef by default

by wjw (Priest)
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074439]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2018-02-19 18:21 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (266 votes). Check out past polls.