There's more than one way to do things | |
PerlMonks |
Re: Entering and exiting subs in styleby pg (Canon) |
on May 27, 2004 at 01:16 UTC ( [id://356777]=note: print w/replies, xml ) | Need Help?? |
You should never call exit from more than one place in your code. If you do, that would become a maintenance nightmare to other people, who might support your code. More importantly, there is absolutely no logical need for this kind of style, as your code should always be coded in a way decent enough to handle all exceptions, and properly return from subs accordingly. If your code does not do that, then fix it, not to tolerate it. Indeed, this breaks modulization, as now other modules are performing functionality (in this case, exit function) that should only be performed by your main module. Purity is not a kind of requirement, but a kind of belief.
In Section
Seekers of Perl Wisdom
|
|