my $fh; my $cpid = do { local $SIG{SEGV} = \&myhandler; open $fh, '-|', '/path/to/prog', @args or die $!; };