Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: exit calling subroutine

by tweetiepooh (Hermit)
on Jan 10, 2008 at 15:44 UTC ( [id://661634]=note: print w/replies, xml ) Need Help??


in reply to exit calling subroutine

Maybe it's my age but I don't like dropping out of routines like this preferring a one way in, one way out approach.
begin(); do_stuff(); end(); sub do_stuff { my status = stuff(); if (status is ok) { more_stuff(); } return status; }
then taking this a little further, make sure that stuff() and more_stuff() return status values
begin(); do_stuff(); end(); sub do_stuff { return stuff() and more_stuff(); }
Real code tends to be more complex than this and sometimes it is cleaner to take the short cut.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found