require POSIX; $SIG{INT} = sub{ warn 'Interupted'; POSIX::close( $_ ) for 0 .. 255; exit; }; #### require POSIX; $SIG{BREAK} = $SIG{INT} = sub{ warn 'Interrupted'; POSIX::close( $_ ) for 0 .. 255; exit; };