Re: getting the value of a var
- From: mpapec@xxxxxxxxx (Matija Papec)
- Date: Sun, 28 Aug 2005 13:01:43 +0200
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?
.
- References:
- getting the value of a var
- From: Octavian Rasnita
- getting the value of a var
- Prev by Date: Re: Need a list of files in a dir.
- Next by Date: Re: getting the value of a var
- Previous by thread: getting the value of a var
- Next by thread: Re: getting the value of a var
- Index(es):
Relevant Pages
|
|