- or download this
use IPC::Open2;
...
use FileHandle;
my($rdr, $wtr) = (FileHandle->new, FileHandle->new);
$pid = open2($rdr, $wtr, $cmd_with_args);
- or download this
use IPC::Open2;
use Symbol;
...
$line = <$RDR>; # read the output of bc(1)
print STDOUT "$line"; # send the output to the user
}
- or download this
$pid = open2($RDR, $WTR, 'sort');
...
while (<$RDR>) { # now read the output of sort(1)
print STDOUT "$_";
}