in reply to Dynamic Symbol Table access
A couple of remarks. You can use symbolic references if you must, and still keep stricture on most of your program by calling { no strict 'refs'; ... } in as small a scope as you can manage.
The symbol table is a hash, and you can examine its keys with keys %Foo::Test::. To get that hash from the string you have, you must again indulge in symrefs,
use Foo::Test; my $x = 'Foo::Test' my @syms = do { no strict 'refs'; keys %{$x . '::'}; };
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Dynamic Symbol Table access
by chromatic (Archbishop) on Sep 22, 2003 at 06:12 UTC |