Hi, Setting $SIG{CHLD} = 'IGNORE' works intermittently, and I'm guessing that's because now I'm ignoring the status all together sometimes.
Better then before, but rather unreliable. I tried some variations with $SIG{CHLD} but no improvements over just using 'IGNORE'. Thanks for the tip. Any more/other ideas how I could get a successful and reliable indication every time? Daniel On Mon, Jul 18, 2005 at 03:17:42PM +0000, Ed Grimm wrote: > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]