Tests 1 and 2 below fail, but 3 and 4 work. The third one isn't great, because it makes me responsible for properly quoting the entire command. The fourth one isn't great either, because the thing we want to run might not be in the PATH.
use strict;
use warnings;
use Data::Dumper;
use IPC::System::Simple qw(run);
my @tests = (
['C:\Program Files\TortoiseSVN\bin\svn.exe', 'help'],
['"C:\Program Files\TortoiseSVN\bin\svn.exe"', 'help'],
['"C:\Program Files\TortoiseSVN\bin\svn.exe" help'],
['svn', 'help'],
);
for (@tests) {
print "Running with run(): ", Dumper($_), "\n";
eval {
run(@$_);
};
if ($@) {
print "Error: [$@]\n";
}
}