$SIG{PIPE} = \&close; sub close{ die "$0: closed\n"; }