To get that hash from the string you have, you must again indulge in symrefs
You can do it with real hash keys, if you know the secret:
package Foo::Bar::Baz; use vars '$quux'; print "What should \$quux hold?\n: "; chomp( $quux = <STDIN> ); package main; use strict; my $hash = \%main::; for my $key (qw( Foo Bar Baz )) { $hash = $hash->{ $key . '::' }; } print "Quux is: ${ $hash->{quux} }\n";
In reply to Re: Re: Dynamic Symbol Table access
by chromatic
in thread Dynamic Symbol Table access
by eak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |