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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scope of variable

Status
Not open for further replies.

gremolin

Programmer
Oct 3, 2002
18
0
0
BG
Hi,
I have a packet, in which i have declarated a hash %some_hash :

package some_package;

my %some_hash = ( key1 => val1, key2 => val2 );


within a function from this package I am calling an other function which is in other package

sub _function {
require the_other_package;

function_from_the_other_package();
}

function_from_the_other_package() need to use %some_hash, but I Don't want to pass it as a parametar to function_from_the_other_package(), because in the_other_package, I have a lot of functions which needs %some_hash. I want to make %some_hash as a global variable into package the_other_package. How can I do that ?
thakns, and I'am sorry for my gramatics errors :)
 
I found how to do what I want.
thank you ;)
 
It'd be helpful if you could post how you did it in the end... :) I'm trying to do the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top