in reply to Zombie-less forking inside a daemon?
So in my expected scenario the above fork "waits" but is really only waiting for the mail process to close the pipe rather than prematurely unwind the current stack frame for subroutine Send. See the perlipc documentation section for the full and very gory details.use POSIX ":sys_wait_h"; ... # important: called within fork sub Send { my $message = shift; my $pid = open my $wh, '| mail ...'; print $wh $message; close $wh; waitpid $pid, 0; }
-M
Free your mind
|
|---|