On Mon, Sep 07, 2015 at 01:49:52PM +0200, Jakub Wilk wrote:
> Hi Peter!
> 
> * Peter Pentchev <[email protected]>, 2015-09-07, 14:26:
> >Hm, this is a personal pet peeve, feel free to ignore it :) ...but it does
> >make me cringe a little bit every time people parse the wait() status code
> >directly instead of using WIFEXITED(), WEXITCODE() and friends...
> 
> In C, sure. But in Perl, fiddling with $? bits is a documented and portable
> method.

Oof.  Right.  Thanks for letting me know that!  The truth is, I'd looked it
up several times in Perl's documentation, but wording like:

  The return value is the exit status of the program as returned by
  the "wait" call.

...in the "system" documentation or:

  Behaves like wait(2) on your system...

...in the "wait" documentation always made me stop reading before I could
actually get to the description of ${^CHILD_ERROR_NATIVE} and the 0x80/0x7f
conversion.  Right now, I actually checked the Perl source to see what it
does with the status code returned by wait(2) and system(3), and, lo and
behold, you're right, it explicitly converts it to this set of values :)

Thanks, and sorry for the bother! :)

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: Digital signature

Reply via email to