Symbol::Global::Name - finds name and type of a global variable
package My; our $VERSION = '0.1'; use Symbol::Global::Name; print Symbol::Global::Name->find( \$VERSION ); # prints '$My::VERSION'
Lookups symbol table to find an element by reference.
Symbol::Global::Name->find( \$VERSION ); Symbol::Global::Name->find( \$VERSION, package => 'My::Package' ); Symbol::Global::Name->find( reference => \$VERSION ); Symbol::Global::Name->find( reference => \$VERSION, package => 'My::Package' );
Takes a reference and optional package name. Returns name of the referenced variable as long as it's in the package or sub-package and it's a global variable. Returned name is prefixed with type sigil, eg. '$', '@', '%', '&' or '*'.
Ruslan Zakirov <ruz@bestpractical.com>
Under the same terms as perl itself.
To install Symbol::Global::Name, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Symbol::Global::Name
CPAN shell
perl -MCPAN -e shell install Symbol::Global::Name
For more information on module installation, please visit the detailed CPAN module installation guide.