Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Hash (not) returned by subroutine

by afoken (Chancellor)
on Jan 27, 2020 at 23:41 UTC ( [id://11111954]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Hash (not) returned by subroutine
in thread Hash (not) returned by subroutine

Doesn’t such a method make the behavior of a programming language unpredictable?

Not if perl is sure that the situation allows optimizing out.

I would blindly assume that all returns could be optimized out in this script:

sub foo { # do something return; } sub bar { # do something return 'a scalar'; } sub baz { # do something return qw( a list ); } foo(); bar(); baz(); exit();

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-25 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found