http://qs321.pair.com?node_id=724856

FreakyGreenLeaky has asked for the wisdom of the Perl Monks concerning the following question:

Greets,

Following on from the great explanation by LanX here Re: Accessing list of package names in a module, I'm now trying to figure out how to dereference a variable who's name has been previously extracted from a module.

Simply put, given the following variable and it's contents (where Util::Stuff:aaa1 comes from a loaded module):
my $var = 'Util::Stuff::aaa1'
I wish to get at the 'flag' value which is defined in Util::Stuff:aaa1 as:
package Util::Stuff::aaa1; sub flag { 10 } ...
Something akin to:
print $"$var" # oogly, I know :-)
ie, "interpolate" the variable to get the actual name before dereferencing.

Possible?
Normal usage of Util::Stuff::aaa1 would be
print Util::Stuff::aaa1->flag ...
Apologies if I haven't explained myself clearly.

Thanks
Henry