Help for this page

Select Code to Download


  1. or download this
    my $pid = open(CHILD, "-|", 'child', @child_args)
    if ($pid) {
      while (<CHILD>) { $logger->($_) }
    }
    close(CHILD);
    
  2. or download this
    if (my $pid = open(CHILD, "-|")) {
      while (<CHILD>) { $logger->($_); }
    ...
      open(STDERR, '>&STDOUT');
      exec('child', @child_args) || die "exec failed";
    }