Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Passing arguments

by monktim (Friar)
on Jan 28, 2004 at 21:53 UTC ( #324801=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://324801]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-12-03 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?