On 8 March 2013 11:49, Dr.Ruud <[email protected]> wrote:

> On 2013-03-07 10:21, WFB wrote:
>
>  waitpid($pid, 0);
>> close($trexe);
>> my $tr_ret = ($?>>8);
>>
>
> Never postpone the reading of a global variable,
> just snapshot it as early as possible.
>
>   my $child = waitpid $pid, 0;
>   my $child_error = $?;  # snapshot a global


>   $child == -1 and die "No child with pid $pid found";
>
>   close $trexe or die "ERROR: $!";
>
>   my $tr_ret = ($child _error >> 8);
>
> I see, that makes sense. Thanks @ all for the tips,
Wolfgang

> --
> Ruud
>
>
>
> --
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> http://learn.perl.org/
>
>
>

Reply via email to