in reply to Running a string through a filter program and recieving the output as a string
You can always use open2 if you want a bidirectional pipe. This program pipes the command to tr(1) to get back a modified command:
use IPC::Open2; open2 ( REA, WRI, 'tr a-z A-Z' ) or die $!; for (<DATA>){ print {\*WRI} [(my $cmd, my @rest) = split]->[0]; } close WRI; print <REA>; __END__ an apple a day boat for bloat
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Running a string through a filter program and recieving the output as a string
by Moron (Curate) on Oct 20, 2005 at 14:57 UTC |
In Section
Seekers of Perl Wisdom