in reply to Capturing stdout and segfault of a program
Under POSIX, the behavior of a program after an involuntary SIGSEGV is undefined. That means that you maybe can kill 11, $pid and catch it in the $pid process, but a genuine segfault may never return from whatever libc call generated it.
Setting signal handlers and capturing output are quite orthogonal. If you can do each, you can do both. I recommend piped ("magic") open for capturing output with a little more control than is given by backticks.
my $fh; my $cpid = do { local $SIG{SEGV} = \&myhandler; open $fh, '-|', '/path/to/prog', @args or die $!; };
After Compline,
Zaxo
|
|---|