http://qs1969.pair.com?node_id=324801


in reply to Passing arguments

#in my calling script my @array = ('a','b','c'); system(qq(perl C:\\script2.pl @array)); print "system failed. [$?]: $!" if ($?); #if args contain spaces my @array = ('a 1','b 2','c 3'); my $args; $args .= '"'.$_.'" ' foreach (@array); system(qq/perl C:\\Backup\\script2.pl $args/); print "system failed. [$?]: $!" if ($?); # Script2.pl my @RecivedArray = @ARGV;; print join(',',@RecivedArray);
Update Added a line of code to check the status of the system call. Also added a block showing arguments that contain spaces.