title: Perl IPC::Cmd doesn't run application if PATH env variable is initialized
body: <p>I'm writing a test script for a library I've written, and as part of the test I'm clearing the $ENV{PATH} variable to make sure that things I've put in my path don't cause successes.  The library appends the needed paths to the PATH variable.</p>
  
  <p>For background, I'm running Strawberry Perl v5.12.0 on 32-bit Windows XP.  IPC::Cmd is at version 0.76 and IPC::Open3 is at version 1.05.</p>
  
  <p>The error that I'm seeing is if I clear the PATH variable and then set it, IPC::Cmd using IPC::Open3 does not find the application.  If I don't do this, then it'll run fine.  Here's an example script that illustrates this error:</p>
  
  <pre><code>use strict;
  use warnings;
  use IPC::Cmd qw(run);
  
  $ENV{PATH} = '';
  $ENV{PATH} = 'c:\\strawberry\\perl\\bin';
  
  my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) =
      run(command =&gt; 'perl -v', verbose =&gt; 0);
  
  if ($success) {
  
      print 'Success: ';
      print join("\n", @{$stdout_buf});
  } else {
  
      print 'Failure: ';
      print join("\n", @{$full_buf});
  }
  exit 0;
  </code></pre>
  
  <p>If I run it like this, it prints the failure line, and if I run it with the two <code>$ENV{PATH} =</code>  commented out then it prints the success line.  I've tried mucking around with the second PATH line by changing the slashes and adding slashes at the end, but this does no good.</p>
  
  <p>I've run this through a debugger, and the failure occurs on line 398 in IPC::Open3:
  <code>$pid = eval { system 1, @_ };         # 1 == P_NOWAIT</code>.  If I check <code>$!</code> after this line, it tells me 'No such file or directory'.  The PATH is still set correctly at this point, it's not getting altered at any point.</p>
  
  <p>One other odd point, I've tried using <code>can_run</code> method from IPC::Cmd after resetting the PATH, and it'll find the command with no problem.</p>
  
  <p>Before submitting a bug report for this, has anyone seen this and know how to fix it?  Also, for what I'm trying to do, is this the correct way, or is there a better way to reset the PATH variable for testing?</p>