perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Grimm <edgr...@dsblade00.wat.us.ray.com>
Subject Re: handling system call exit status
Date Mon, 18 Jul 2005 15:17:42 GMT
On Fri, 15 Jul 2005, Daniel wrote:

> Sometimes I see strange numbers when handling exit status from system
> calls.
>
>     my $out = `$cmd`;
>     my $stat = $? >> 8;
>
> and $stat may contain anumber like  16777215 at this point, whereas on
> commandline it would be more like 2, or no error at all (0).

I'd think it would always be 16777215 in this situation.  I believe your
children are being automatically reaped, as described in the perlfunc
manpage under wait (system references wait as the source of its return
code.)  IIRC, to get perl to stop auto-reaping ones process children,
one sets $SIG{CLD} to a reap function.

Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message