Help for this page

Select Code to Download


  1. or download this
    my $pid = open2($rfh, $wfh, "ssh $opts $hostspec $cmd");
    
  2. or download this
    ### Self-pipe init.
    pipe(SIGRD, SIGWR);
    # Make SIGRD non-blocking.
    vec($rin, fileno SIGRD, 1) = 1;
    
  3. or download this
    my $byte = 1;
    syswrite(SIGWR, $byte, 1);
    
  4. or download this
    my $nfound = select($rout = $rin, $wout = $win, undef, undef);
    # Check $nfound for errors.
    ...
        # CHLD arrived, do waitpid(), modify some data, ...
      }
    }