Subject: | ampersand in argument handled incorrectly if IPC::Run is used |
perl, v5.10.0 built for i486-linux-gnu-thread-multi
IPC::Cmd 0.54
IPC::Run 0.84
Ubuntu 9.04
I've attached the following runner scripts:
ipc_cmd_ipc_open3.pl
ipc_cmd_ipc_run.pl
ipc_cmd_system.pl
ipc_run.pl
They all do what their names suggest i.e. run a command using IPC::Cmd
(with three different options) or IPC::Run.
I've also attached a simple command, runnee.pl, which prints a
Data::Dumper dump of its arguments.
I invoke the runners with the following arguments (note the ampersand in
the final argument):
foo 1 'bar' "isn't" "http://www.test.com?foo=bar&baz=quux"
e.g.
./ipc_cmd_system.pl foo 1 'bar' "isn't"
"http://www.test.com?foo=bar&baz=quux"
This works fine for IPC::Run, IPC::Cmd using IPC::Open3, and IPC::Cmd
using system(), but breaks for IPC::Cmd using IPC::Run. In the latter
case, the final argument is not received by the command.
chocolateboy
Subject: | ipc_cmd_ipc_open3.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(:5.10);
use Data::Dumper; $Data::Dumper::Terse = $Data::Dumper::Indent = 1;
use IPC::Cmd qw(run);;
say "runner (IPC::Cmd(IPC::Open3)) args: ", Dumper(\@ARGV);
$IPC::Cmd::USE_IPC_RUN = 0;
$IPC::Cmd::USE_IPC_OPEN3 = 1;
$IPC::Cmd::DEBUG = 1;
my ($ok, $err) = run(
command => [ './runnee.pl', @ARGV ],
verbose => 1
);
die "error: $err" unless ($ok);
Subject: | runnee.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(:5.10);
use Data::Dumper; $Data::Dumper::Terse = $Data::Dumper::Indent = 1;
say "runnee args: ", Dumper(\@ARGV);
Subject: | ipc_run.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(:5.10);
use Data::Dumper; $Data::Dumper::Terse = $Data::Dumper::Indent = 1;
use IPC::Run qw(run);;
say "runner (IPC::Run) args: ", Dumper(\@ARGV);
$ENV{IPCRUNDEBUG} = 'basic';
my $ok = run([ './runnee.pl', @ARGV ]);
die "error: $?" unless ($ok);
Subject: | ipc_cmd_system.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(:5.10);
use Data::Dumper; $Data::Dumper::Terse = $Data::Dumper::Indent = 1;
use IPC::Cmd qw(run);;
say "runner (IPC::Cmd(system)) args: ", Dumper(\@ARGV);
$IPC::Cmd::USE_IPC_RUN = 0;
$IPC::Cmd::USE_IPC_OPEN3 = 0;
$IPC::Cmd::DEBUG = 1;
my ($ok, $err) = run(
command => [ './runnee.pl', @ARGV ],
verbose => 1
);
die "error: $err" unless ($ok);
Subject: | ipc_cmd_ipc_run.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(:5.10);
use Data::Dumper; $Data::Dumper::Terse = $Data::Dumper::Indent = 1;
use IPC::Cmd qw(run);;
say "runner (IPC::Cmd(IPC::Run)) args: ", Dumper(\@ARGV);
$IPC::Cmd::USE_IPC_RUN = 1;
$IPC::Cmd::USE_IPC_OPEN3 = 0;
$IPC::Cmd::DEBUG = 1;
$ENV{IPCRUNDEBUG} = 'basic';
my ($ok, $err) = run(
command => [ './runnee.pl', @ARGV ],
verbose => 1
);
die "error: $err" unless ($ok);