in reply to Re: look up the symbol table of a variable
in thread look up the symbol table of a variable

When I try:

use strict; use Foo::Bar; my $package = 'Foo::Bar'; for my $sym ( keys %{ $::{ "${package}::" } } ) { print "$sym\n"; }
...I get no output, but with this I do:
use strict; use Foo::Bar; my $package = 'Foo::Bar'; { no strict q(refs); for my $sym ( keys %{ "${package}::" } ) { print "$sym\n"; } } __END__ PI import
For both, Foo/Bar.pm is
package Foo::Bar; $PI = 3.14; __END__

Update: Simplified code a bit.

the lowliest monk

Replies are listed 'Best First'.
Re^3: look up the symbol table of a variable
by chas (Priest) on Apr 24, 2005 at 23:22 UTC
    Yes, I think you are correct. (See the 2nd update in my previous reply.)
    chas