in reply to IPC::Cmd pipe array
IPC::Cmd's command option takes one string or array reference that specifies your command. Since you have a pipe "|" in your command(s), you are stuck with specifying a string. Or you can try IPC::Run
use IPC::Run qw(run); my @in = ("Test foo", "Test bar"); run [echo => -n => @in] , '|', [ sed => "s/(foo|bar)/pass/" ], '>', \m +y $out;
In Section
Seekers of Perl Wisdom