CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Accessing parameters in system(@args)

 



amaselli
New User

Feb 24, 2009, 2:40 PM

Post #1 of 3 (785 views)
Accessing parameters in system(@args) Can't Post

I have ran into the problem of accessing the parameters when I call one perl script with another perl script.

Here is the code I have so far.

#test.pl
$hello = "Meow";
@args=("find.pl","$hello");
system(@args);

Now how do I access the parameter $hello inside of 'find.pl', I have tried the following:
print $_[0];
print $_[1];
print @_;
print $hello;

Please help!!

Thanks,
Andrew


KevinR
Veteran


Feb 24, 2009, 4:42 PM

Post #2 of 3 (779 views)
Re: [amaselli] Accessing parameters in system(@args) [In reply to] Can't Post

@ARGV is the array that imports the arguments to a script, so $ARGV[0] is the variable you are looking for.
-------------------------------------------------


amaselli
New User

Feb 24, 2009, 4:47 PM

Post #3 of 3 (776 views)
Re: [KevinR] Accessing parameters in system(@args) [In reply to] Can't Post

Thank you Kevin, works perfectly.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives