Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Hope a subroutine will return undef by default

by LanX (Canon)
on Feb 12, 2014 at 01:00 UTC ( #1074565=note: print w/ replies, xml ) Need Help??


in reply to Re: Hope a subroutine will return undef by default
in thread Hope a subroutine will return undef by default

> what language are you actually trying to mimic here?

At least Javascript comes to mind (update: and Python)

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re^2: Hope a subroutine will return undef by default
Re^3: Hope a subroutine will return undef by default
by qj1020 (Initiate) on Feb 12, 2014 at 22:07 UTC
    You are right, javascript does this. "return ;" in the middle of a function has the same return value as the case when execution of the function goes the end of the function body without a return statement --- both cases return "undefined" or null. No surprises.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-07-24 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls