Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Passing arguments

by monktim (Friar)
on Jan 28, 2004 at 21:53 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found