title: Running a batch file from Perl (Activestate perl in Windows)
body: <p>I have a Perl program which does something like below:</p>
  
  <pre><code>#!/usr/bin/env perl    
  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 &gt; c:\\tmp\\out.txt 2&gt;&amp;1");
  
  print "$status\n";
  </code></pre>
  
  <p>I am calling this Perl code in an eval block. When invoked, i get the status printed as 0, but the batch file has not actually executed. What would be the reason for this? Any issue with the 'system' call coded above?</p>
  
  <p>Thanks,
  Jits</p>