in reply to Re^5: Cannot catch ALRM signal for timeout
in thread Cannot catch ALRM signal for timeout

what makes you think it's stuck? Are you sure it's really stuck and that you're not suffering from buffering? Add
OUTPUT_FILE->autoflush(1);
after the open. You'll need
use IO::Handle qw( );
at the top.