The dir
command in Python 2.7.x lists all accessible 'symbols' from a module.
Is there an equivalent in Perl 5.x to list all accessible 'symbols' from a package?
The dir
command in Python 2.7.x lists all accessible 'symbols' from a module.
Is there an equivalent in Perl 5.x to list all accessible 'symbols' from a package?
say for sort keys %Foo::Bar::;
You can use
*Foo::Bar::sym{SCALAR}
*Foo::Bar::sym{ARRAY}
*Foo::Bar::sym{HASH}
etc
to see if the symbol has those a variable of the specified type associated with it.