diff options
-rw-r--r-- | README.win32 | 5 | ||||
-rw-r--r-- | pod/perlfaq8.pod | 2 | ||||
-rw-r--r-- | pod/perlfunc.pod | 12 | ||||
-rw-r--r-- | pod/perlop.pod | 13 | ||||
-rw-r--r-- | pod/perlport.pod | 6 |
5 files changed, 24 insertions, 14 deletions
diff --git a/README.win32 b/README.win32 index 880a8b408e..dfd6eb09f2 100644 --- a/README.win32 +++ b/README.win32 @@ -700,8 +700,9 @@ C<kill()> is implemented, but doesn't have the semantics of C<raise()>, i.e. it doesn't send a signal to the identified process like it does on Unix platforms. Instead it immediately calls C<TerminateProcess(process,signal)>. Thus the signal argument is -used to set the exit-status of the terminated process. This behavior -may change in future. +used to set the exit-status of the terminated process. In particular, +C<kill(0,$pid)> will kill the process identified by C<$pid> (unlike +on Unix). This behavior may change in future. =item * diff --git a/pod/perlfaq8.pod b/pod/perlfaq8.pod index 26efa3fbb2..f8dda0d9b8 100644 --- a/pod/perlfaq8.pod +++ b/pod/perlfaq8.pod @@ -935,7 +935,7 @@ the current process group of your controlling terminal as follows: =head2 How do I timeout a slow event? Use the alarm() function, probably in conjunction with a signal -handler, as documented L<perlipc/"Signals"> and chapter 6 of the +handler, as documented in L<perlipc/"Signals"> and chapter 6 of the Camel. You may instead use the more flexible Sys::AlarmCall module available from CPAN. diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 910510804c..d8c82bbeda 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2118,17 +2118,21 @@ as trying has no effect). See also C<each>, C<values> and C<sort>. -=item kill LIST +=item kill SIGNAL, LIST -Sends a signal to a list of processes. The first element of -the list must be the signal to send. Returns the number of +Sends a signal to a list of processes. Returns the number of processes successfully signaled (which is not necessarily the same as the number actually killed). $cnt = kill 1, $child1, $child2; kill 9, @goners; -Unlike in the shell, in Perl if the I<SIGNAL> is negative, it kills +If SIGNAL is zero, no signal is sent to the process. This is a +useful way to check that the process is alive and hasn't changed +its UID. See L<perlport> for notes on the portability of this +construct. + +Unlike in the shell, if SIGNAL is negative, it kills process groups instead of processes. (On System V, a negative I<PROCESS> number will also kill process groups, but that's not portable.) That means you usually want to use positive not negative signals. You may also diff --git a/pod/perlop.pod b/pod/perlop.pod index 14ca6b5ec0..01074b3096 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -510,10 +510,10 @@ The following are recognized: Although these are grouped by family, they all have the precedence of assignment. -Unlike in C, the assignment operator produces a valid lvalue. Modifying -an assignment is equivalent to doing the assignment and then modifying -the variable that was assigned to. This is useful for modifying -a copy of something, like this: +Unlike in C, the scalar assignment operator produces a valid lvalue. +Modifying an assignment is equivalent to doing the assignment and +then modifying the variable that was assigned to. This is useful +for modifying a copy of something, like this: ($tmp = $global) =~ tr [A-Z] [a-z]; @@ -526,6 +526,11 @@ is equivalent to $a += 2; $a *= 3; +Similarly, a list assignment in list context produces the list of +lvalues assigned to, and a list assignment in scalar context returns +the number of elements produced by the expression on the right hand +side of the assignment. + =head2 Comma Operator Binary "," is the comma operator. In scalar context it evaluates diff --git a/pod/perlport.pod b/pod/perlport.pod index 6b532f3777..3fd4352932 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1452,13 +1452,13 @@ in the Winsock API does. (Win32) Available only for socket handles. (S<RISC OS>) -=item kill LIST +=item kill SIGNAL, LIST Not implemented, hence not useful for taint checking. (S<Mac OS>, S<RISC OS>) -Available only for process handles returned by the C<system(1, ...)> -method of spawning a process. (Win32) +Unlike Unix platforms, C<kill(0, $pid)> will actually terminate +the process. (Win32) =item link OLDFILE,NEWFILE |