The stupid question is the question not asked | |
PerlMonks |
Re: Accessing variables in a runtime-loaded moduleby splinky (Hermit) |
on Jun 09, 2005 at 13:31 UTC ( [id://465118]=note: print w/replies, xml ) | Need Help?? |
The correct syntax for accessing a variable inside another package is $pkgname::varname, but note that this only works if varname is a package variable. If it's lexical (my $varname), then you can't get to it at all from outside the package.
Given that you have the package name inside a variable, things get a little messy. I couldn't find a way to do it without "eval":
In Section
Seekers of Perl Wisdom
|
|