http://www.perlmonks.org?node_id=928599


in reply to Re^3: Has anyone seen perl losing arguments?
in thread Has anyone seen perl losing arguments?

Thanks for your help

No, I didn't dumper it. rather, I just print intermediate results, until the program has been shown to be working OK.

The shell is Windows Server Web's cmd

Here are the contents of my IPC.test.pl script:

use strict; use warnings; use IPC::System::Simple qw(system systemx capture capturex); $| = 1; my $cmd = 'argv.test.pl qwerty asdfghjk zxcv'; my $op = `$cmd`; print "==============\n",$op,"\n\n=================\n"; my @args; push @args,'argv.test.pl'; push @args,"\"qwerty 12354\""; push @args,'asdfg'; push @args,'zxcvbnm'; system('perl',@args); print "\n\n==============\n"; systemx('perl',@args); print "\n\n==============\n";

And there are the contents of 'argv.test.pl'

print "$ARGV[0]\n\t$ARGV[1]\n\t\t$ARGV[2]\n";

and here is what is written to standard out:

C:/Perl64.v.5.14/bin\perl.exe -w c:/Work/IPC.test.pl ============== ================= qwerty 12354 asdfg zxcvbnm ============== qwerty 12354 asdfg zxcvbnm ==============

So, it is clear that my way forward is to use IPC::System::Simple. But what is not clear is why using the default system and back ticks worked fine on WIndows 7, Windows XP, and Windows Server 2003, but fails miserably on Windows Server Web. But I am not going to worry too much about that as long as I can quickly get these programs working again.

Thanks again.