in reply to Self resurrecting perl scripts

Apart from the various Perl-based solutions, if you have or can get root access on the box that the script will be running on, you can use 'init', to automagically re-run the script for you should it ever exit.

This doesn't help with determining why it died in the first place, nor reacting appropriately based on the cause of death. init is fairly simple. If the runlevel is appropriate, and the process isn't running, respawn it.