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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
How to retain variable values between scripts?



Jun 14, 2000, 11:28 AM

Post #1 of 2 (490 views)
How to retain variable values between scripts? Can't Post

I am trying to carry over the value of variables derived in one script into another.

Basically, I have one script that randomly assigns a value to a variable and then runs another script. Is it possible to have the second script remember the values assigned in the first script?

I was able to do this by writing the information to a text file before running the second script, but I was hoping there was a way to do it without the temporary file. I have also tried the, but have not succesfully gotten it to work.

any help much appreciated!


Jun 14, 2000, 1:33 PM

Post #2 of 2 (490 views)
Re: How to retain variable values between scripts? [In reply to] Can't Post

Well, there are a variety of ways this can be done and it depends on the nature of the programs and how they are to be run.

You can open a pipe to a program and print data to it:

open (FILE, "|PROGRAM");
print FILE "Data....";
print FILE "It's up to PROGRAM";
print FILE "read the data and process it";
close FILE;

You could also use the system function and send arguements.

system(PROGRAM, ARGS);

Dr. Zed


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

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