Hey,
A not Perl answer (just because it`s an option)
If you have control of the box, let the script
be spawned by init... It will keep an eye on it, and
restart it, if nescesarry (nice Scrabble word, but I
can't spell it)
GreetZ!,
print "profeth still\n" if /bird|devil/;