in reply to exit calling subroutine
then taking this a little further, make sure that stuff() and more_stuff() return status valuesbegin(); do_stuff(); end(); sub do_stuff { my status = stuff(); if (status is ok) { more_stuff(); } return status; }
Real code tends to be more complex than this and sometimes it is cleaner to take the short cut.begin(); do_stuff(); end(); sub do_stuff { return stuff() and more_stuff(); }
|
|---|