title: Perl command not being executed as part of a script
body: <p>I have a Perl script <code>wrapper.pl</code> with a piece of code that looks like this: </p>
  
  <pre><code>if (-e "$run_dir/fd3d/VrtMsgBus.txt") {
  
      print "VRTMSGBUS: non scalablity mode VrtMsgBus.txt exists\n";  
  
  
      $conf-&gt;{'script_list'}{'vrt_scalability'} = {
          'cmd'       =&gt; "perl $script_dir/hevc_enc/pak_rtl/vrt_scalability.pl $run_dir $hevc_fd3d_dir $script_dir",
          'dumpdir'   =&gt; $dumpdir,
          'units'     =&gt; [qw(hwm hle vne hvd hsse hit hpo hfq hft hpr hrs hlc hmc hpp hed vnc htq hsao hmx hlf)],
          'requires'  =&gt; [qw(vrtmsgbus mv_vrtmsgbus mv_vrtmsgbus_org mv_vrtmsgbus_no_scalability)],
      };
  }
  else {
  
      print "VRTMSGBUS: scalablity mode, VrtMsgBus.txt doesnt exist\n";
  
      $conf-&gt;{'script_list'}{'vrt_scalability_2'} = {
          'cmd'       =&gt; "perl $script_dir/hevc_enc/pak_rtl/vrt_scalability.pl $run_dir $hevc_fd3d_dir $script_dir",
          'dumpdir'   =&gt; $dumpdir,
          'units'     =&gt; [qw(hwm hle vne hvd hsse hit hpo hfq hft hpr hrs hlc hmc hpp hed vnc htq hsao hmx hlf)],
      };
  
  
  }   
  </code></pre>
  
  <p>I'm trying to execute a particular script <code>vrt_scalability.pl</code> for different conditions in the manner shown in the code. <code>vrt_scalability.p</code>' is a separate script that works from the command line, but when I try to execute it using this <code>wrapper.pl</code> it fails. How do I debug this kind of code?</p>
  
  <p>Also, the commands called in the <code>cmd</code> part of this code are all working when I run them independent of <code>wrapper.pl</code>. What could I be doing wrong?</p>
  
  <p>Executing the scripts here:</p>
  
  <pre><code>sub ExecScripts {
  
     foreach my $exec_script_name (keys %{$conf-&gt;{'exec_list'}})
      {
  
      $conf-&gt;{'exec_list'}{$exec_script_name}{'script_was_executed'} = 0;
  
  }
  
  foreach my $exec_script_name (keys %{$conf-&gt;{'exec_list'}})
  {
  
      my $dependency_script = $conf-&gt;{'exec_list'}{$exec_script_name};
      if (exists $dependency_script-&gt;{'requires'})
      {
          foreach my $parent_script (@{$dependency_script-&gt;{'requires'}})
          {
  
              ExecDependencyScripts($conf, $parent_script);
          }
      }  
  </code></pre>