I have a Perl program that does something like below:
use strict;
use warnings;
my $exe = "C:\\project\\set_env_and_run.bat";
my $arg1 = "\\\\Server\\share\\folder1";
my $arg2 = "D:\\output\\folder1";
my $cmd = "$exe \"$arg1\" \"$arg2\"";
my $status = system("$cmd > c:\\tmp\\out.txt 2>&1");
print "$status\n";
I call this Perl code in an eval block. When I call, I get the status printed as 0, but the batch file is actually not executed. What is the reason for this? Any problem with the "system" code encoded above?
Thanks Jits
source
share