here is another way of doing things ;) unfortunately i was unable to implement it - it just did not work - but i know it is possible:
the Fatal.pm module allows to make some function calls die if they return undef - handy for e.g. open etc. i thought i could do this for the die call for myself (for example, call two functions named One () and Two () before dieing :), looked at the modules source - the rest can be read above...
perhaps one can put here the correct way of doing this? or is this way considered more harmful?