Help for this page

Select Code to Download


  1. or download this
    use POSIX qw( WNOHANG );
    
    ...
    }
    
    print "Command completed with exit code $?.\n";
    
  2. or download this
    my $pid = system(1,'perl -e"sleep(4); exit(5);"');
    
    waitpid($pid, 0);
    die $! if $? < 0;
    print "Command completed with exit code $?.\n";