Subject: | problem with spaces in path |
Date: | Sun, 10 Aug 2014 22:34:17 -0400 |
To: | bug-IPC-Run [...] rt.cpan.org |
From: | Peter Eisentraut <peter [...] eisentraut.org> |
Consider this simple test program:
use IPC::Run qw(run);
run(['foo']);
and a program 'foo' in a subdirectory with spaces in the name:
mkdir 'foo bar'
cp /usr/bin/true 'foo bar'/foo
Then this fails:
$ PATH="$PWD/foo bar:$PATH" perl ./test.pl
exec failed: No such file or directory at ./test.pl line 3.
at ./test.pl line 3.
But if the directory name does not have a space, it works:
$ PATH="$PWD/foo_bar:$PATH" perl ./test.pl
It also works if the command array reference has more than one element,
e.g.,
use IPC::Run qw(run);
run(['foo', '--']);