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!

open file for output????

Status
Not open for further replies.

Porshe

Programmer
Jun 5, 2001
38
0
0
US
Hi! I have a script called find.pl that has a variable $source= 132.45.76.89;
($source changes with each foreach loop that I have).
I have another script called last.pl that needs to take $source from find.pl, do some stuff with it and give find.pl the results.
I'm thinking that I can open last.pl with a file handle and put the output in find.pl.

Help~ Thanks!
Porshe
 
If you're trying to read last.pl from find.pl, use the require function:

require "last.pl";



----------------------------------------
There is no Knowledge, That is not power.

Yes, i'm a MySQL Newbie.
-Aaron
----------------------------------------
 
If I understand what you want is to run a perl script with an argument and capture the output from the perl script. Here's one way to do that:

:in find.pl
$output = `last.pl $source`;
# Do whatever you want with $output from last.pl

:in last.pl
$src = $ARGV[0];
# Do something with $src
print "whatever you want to output to find.pl";

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top