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