more useful options | |
PerlMonks |
Re: Self resurrecting perl scriptsby perigeeV (Hermit) |
on Apr 11, 2001 at 20:44 UTC ( [id://71740]=note: print w/replies, xml ) | Need Help?? |
I had something similar once. My answer wasn't awfully pretty, but it worked. I wrapped each step into its own function, and had each sub return a unique error code upon failure instead of dying. One sub would return 12, another would return 8, etc. The main code in the program would then be able to handle each error condition as it happened, knowing exactly what blew up. Just try to keep the sub calls out of loops if you don't want to eat too many cycles.
In Section
Seekers of Perl Wisdom
|
|