Octavian Rasnita wrote:

my $module = "Teddy::Languages::${lang}::${mod}";
eval "require $module";

Then I want to print that value, but I don't know how.

I have tried:

print Teddy::Languages::$lang::$mod::content;
print $module::content;

I am missing something and I cannot make it work. Please help me.

If everything fails you can access package variables via symbol table,

#symbol table
my $st = eval '\%$module::';
# scalar reference
$sref = *{ $st->{content} }{SCALAR};
print $$sref;

perhaps you could rearrange your problem so it wouldn't use such access to globals?

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to