in reply to IPC::Run on WindowsXP/Windows Server 2003?

Update (this is why):

Looking inside IPC/Run.pm, the harness sub has the following:
my @args ; if ( @_ == 1 && ! ref $_[0] ) { if ( Win32_MODE ) { @args = ( [ qw( command /c ), win32_parse_cmd_line $_[0] ] ) +; } else { @args = ( [ qw( sh -c ), @_ ] ) ; } } elsif ( @_ > 1 && ! grep ref $_, @_ ) { @args = ( [ @_ ] ) ; } else { @args = @_ ; }

Thus, the following:
use IPC::Run qw(run harness); # This will work my $h = harness "perl", "-v"; run $h; print "\n\n-------------------\n"; print "Calling harness with one arg..."; print "\n-------------------\n\n"; #This will not work if you don't have command.com my $h2 = harness "perl -v"; run $h2;

Replies are listed 'Best First'.
Re^2: IPC::Run on WindowsXP/Windows Server 2003?
by DrWhy (Chaplain) on Jun 11, 2008 at 15:07 UTC
    Thanks for pointing that out; that's exactly the problem point. I've fixed this for now by modifying my wrapper to do this same processing (but using cmd.exe instead of command.com) before it calls IPC::Run's harness constructor so this bad line of code is never hit.

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."