Why is Perl's $? returning the wrong value for the exit code of a forked process?

前端 未结 2 1962
小鲜肉
小鲜肉 2021-01-05 17:22

Consider this trivial example of fork()ing then waiting for a child to die in Perl:

#!/usr/bin/perl

use strict;
use warnings;

if (fork() == 0) {
        ex         


        
2条回答
提交回复
热议问题