ag4ve has asked for the wisdom of the Perl Monks concerning the following question:
I'm running up against the pipe buffer doing this:
my $success = run [$echo => -e => "\'" => join("\n", @iptout) => "\'"], '|', [$ipt_cmd => 'iptables-restore'], '>', \my $cmdout, '2>&1';
Error:
exec failed: Argument list too long at ./firewall.pl line 852So, I figured I'd try this:
my $success = run [$ipt_cmd => 'iptables-restore'], '>', \my $cmdout, '2>&1', '<<<', '${', [$echo => -e => "\'" => join("\n", @iptout) => +"\'"], '}';
Error:
No such file or directory: open( <<, 0x000 ) at ./firewall.pl line 852But I can't figure out how to get it in proper syntax for IPC::Run? Also, per the limit I'm hitting 'man 7 pipe (I'm running 3.10+ on 64 bit, but this is the latest pipe manpage): In Linux versions before 2.6.11, the capacity of a pipe was the same as the system page size (e.g., 4096 bytes on i386). Since Linux 2.6.11, the pipe capacity is 65536 bytes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IPC::Run / bash pipe
by runrig (Abbot) on Nov 07, 2013 at 00:56 UTC | |
by ag4ve (Monk) on Nov 07, 2013 at 01:53 UTC | |
by ag4ve (Monk) on Nov 07, 2013 at 02:11 UTC |