From: Philip Newton Date: Thu, 27 Dec 2001 10:04:17 +0000 (+0100) Subject: [DOC PATCH] left is right and right is left X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7717d0e77b96bf76bebc74673d55b9b999ab09af;p=p5sagit%2Fp5-mst-13.2.git [DOC PATCH] left is right and right is left Message-ID: p4raw-id: //depot/perl@13905 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 516d875..188d800 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5377,7 +5377,7 @@ to set C<$|> ($AUTOFLUSH in English) or call the C method of C on any open handles. The return value is the exit status of the program as returned by the -C call. To get the actual exit value shift left by eight (see below). +C call. To get the actual exit value shift right by eight (see below). See also L. This is I what you want to use to capture the output from a command, for that you should use merely backticks or C, as described in L. Return value of -1 @@ -5401,7 +5401,7 @@ C<$?> like this: $signal_num = $? & 127; $dumped_core = $? & 128; -or more portably by using the W*() calls of the POSIX extension, +or more portably by using the W*() calls of the POSIX extension; see L for more information. When the arguments get executed via the system shell, results diff --git a/pod/perlport.pod b/pod/perlport.pod index a213348..9b81ca5 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1780,13 +1780,13 @@ OS>, OS/390, VM/ESA) =item system LIST In general, do not assume the UNIX/POSIX semantics that you can shift -the C<$?> left by eight to get the exit value, or that C<$? & 127> +C<$?> right by eight to get the exit value, or that C<$? & 127> would give you the number of the signal that terminated the program, or that C<$? & 128> would test true if the program was terminated by a coredump. Instead, use the POSIX W*() interfaces: for example, use WIFEXITED($?) an WEXITVALUE($?) to test for a normal exit and the exit value, and WIFSIGNALED($?) and WTERMSIG($?) for a signal exit and the -signal. Core dumping is not a portable concept so there's no portable +signal. Core dumping is not a portable concept, so there's no portable way to test for that. Only implemented if ToolServer is installed. (S)