in reply to Too many "or die" clauses?
I do appreciate TGI's approach, even though it looks a little more cumbersome than it really is. Another approach, if most of your "or die ..." clauses are tacked onto the same functions (system, chdir, a few others?), you could just set up a module with customized versions (and customized names) for these frequently used functions -- e.g. instead of calling "system()", use a module that you call "Safe.pm", and call "safe_system()", which would take an extra arg (either first or last) to supply a message for the "die".
BTW, I noticed, on reading the Fatal docs for the first time, that it does not support redefining/overriding the system() function, which seems to limit its value in your case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Too many "or die" clauses?
by TGI (Parson) on Jun 17, 2008 at 17:00 UTC |