Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-30 10:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls