Greetings fellow monks,
I have a file "friends.pm" which contains this :
my %friends = (Paul => 1, Suzie => 1);
and now I'd like to import this into my main namespace, so that I could so something simple like
# %friends isn't defined as of this line do "friends.pm"; # doesn't work foreach my $friend (keys %friends) { # etc ... }
I'm looking for a quick and easy way to do this. Import the variable declared in another file into the current namespace.
thanks you for sharing the wisdom, may the Perl be with you
Amen.
In reply to IMport a variable from another file by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |