Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking to pass variables to another perl script

Status
Not open for further replies.

matterhorn2001

Programmer
Feb 12, 2009
4
US
Hello,
I am looking to take variables and pass them to another perl script. However, the script that I am looking to pass the variables into does not accept any command line arguments. I am hoping to be able to open the script and then pass the variables in as needed.

Any help would be great. At this point I have looked into the open() command but not sure if this will accomplish what I am looking to do. Any ideas?

Please let me know if any clarification is needed. Thanks in advance!!!

-Matt
 
open() might work. Write the stuff you want to import to the script to a file, then open the file and read the data into the script.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
You could also set environment variables and access them from the perl script. Probably less of a hassle than using file-based variable approach
 
you could also use storable.pm to serialize any data structures you may wish to pass

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top