in reply to Self resurrecting perl scripts
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.
|
|---|