Symbol::Global::Name(3pm)

Symbol::Global::Name3pm

Finds name and type of a global variable

Usage

    package My;
    our $VERSION = '0.1';
    use Symbol::Global::Name;
    print Symbol::Global::Name->find( \$VERSION );
    # prints '$My::VERSION'

Overview

Lookups symbol table to find an element by reference.

Methods

find

    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 '*'.

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8–10
  2. 11
  3. 12–13

Author

Ruslan Zakirov <[email protected]>

License

Under the same terms as perl itself.

From libsymbol-global-name-perl 0.05-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.