You place a lot of code into your signal handler. Older perls have real problems with that. Newer perls try to cope with the underlying problem by default, but can still show the old behaviour. See "Signals" and "Deferred Signals (Safe Signals)" in perlipc. The safe way of handling signals is just to set a flag and handle the signal in the main loop of the program.
Your signal handler modifies errno a.k.a. $!.
The code both inside and outside of your signal handler lacks lots of error checks, and you are not using autodie.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)