in reply to How to print to STDIN of a cmd and read it's STDOUT
#!/usr/bin/perl use strict; use warnings; use IPC::Open2; my $pid = open2(my $OUT, my $IN, "/bin/sed", "s/h/H/"); print $IN "hallo\n"; close $IN; print <$OUT>;
Output:
Hallo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to print to STDIN of a cmd and read it's STDOUT
by mhearse (Chaplain) on May 14, 2013 at 23:52 UTC |