in reply to IPC::Run / bash pipe
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";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: IPC::Run / bash pipe
by ag4ve (Monk) on Nov 07, 2013 at 01:53 UTC | |
by ag4ve (Monk) on Nov 07, 2013 at 02:11 UTC |
In Section
Seekers of Perl Wisdom