What is '<<<' supposed to be?
Also, I'm not sure what you're trying to accomplish with the quoting, but I don't think you're doing it correctly. If you have the input for your command in a string, then just use it:use IPC::Run qw(run); my @arr = qw( abc def ); my $input = join("", map "$_\n", @arr); run [ sed => 's/[ad]/o/' ], "<", \$input, ">", \my $output; print "O: [$output]\n";
Or compare these various quoting strategies (the first is similar to yours and I believe incorrect, the last is more like what I think you're trying to accomplish):
use IPC::Run qw(run); my @arr = qw( abc def ); run [ echo => q(') => join("\n", @arr) => q(') ], ">", \my $output; print "O: [$output]\n"; run [ echo => q(') . join("\n", @arr) . q(') ], ">", \my $output; print "O: [$output]\n"; run [ echo => join("\n", @arr) ], ">", \my $output; print "O: [$output]\n";
In reply to Re: IPC::Run / bash pipe
by runrig
in thread IPC::Run / bash pipe
by ag4ve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |