X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlipc.pod;h=c75fa958d09dca8687f63365e731d7c36540bc14;hb=3e79b69bf4e5ee29a68ea7ec363a1195dc7fddf5;hp=3af062f6b468dddb2c65b87e803fe7c9bf7e50c2;hpb=28494392d67f95ee74740353c8e635f622ffe336;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlipc.pod b/pod/perlipc.pod index 3af062f..c75fa95 100644 --- a/pod/perlipc.pod +++ b/pod/perlipc.pod @@ -179,9 +179,11 @@ the process. Many daemons provide this mechanism using the C signal handler. When you want to tell the daemon to re-read the file you simply send it the C signal. -The implementation of such a mechanism in Perl using a normal signal -handler works only the first time the signal is sent. The solution to -this problem is to use C signal handlers if available. +Not all platforms automatically reinstall their (native) signal +handlers after a signal delivery. This means that the handler works +only the first time the signal is sent. The solution to this problem +is to use C signal handlers if available, their behaviour +is well-defined. The following example implements a simple daemon, which restarts itself every time the C signal is received. The actual code is @@ -568,6 +570,16 @@ And here's a safe pipe open for writing: # NOTREACHED } +Since Perl 5.8.0, you can also use the list form of C for pipes : +the syntax + + open KID_PS, "-|", "ps", "aux" or die $!; + +forks the ps(1) command (without spawning a shell, as there are more than +three arguments to open()), and reads its standard output via the +C filehandle. The corresponding syntax to read from command +pipes (with C<"|-"> in place of C<"-|">) is also implemented. + Note that these operations are full Unix forks, which means they may not be correctly implemented on alien systems. Additionally, these are not true multithreading. If you'd like to learn more about threading, see the