This is necessary since we want to be able to do arbitrary redirects
via the popen interface. Oh well, we'll be a little slower for now
for users without vfork. vfork users will get all the performance
benefits.
sub popen_rd {
my ($cmd, $env, $opts) = @_;
- unless (wantarray || defined $vfork_spawn || defined $env) {
- open my $fh, '-|', @$cmd or
- die('open `'.join(' ', @$cmd) . " pipe failed: $!\n");
- return $fh
- }
pipe(my ($r, $w)) or die "pipe: $!\n";
$opts ||= {};
my $blocking = $opts->{Blocking};