Symbol::Table

An easy interface to symbol tables (no eval(), no *typeglobs)
Download

Symbol::Table Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Greg London
  • Publisher web site:
  • http://search.cpan.org/~gslondon/

Symbol::Table Tags


Symbol::Table Description

An easy interface to symbol tables (no eval(), no *typeglobs) Symbol::Table is a Perl module that allows the user to manipulate Perl's symbol table while hiding all those nasty eval's and *typeglobs from the user. Symbol::Table gives the user an object oriented interface to perl's actual symbol table. The constructor returns a reference to a tied hash as a Symbol::Table object.The object acts like a reference to a hash: the keys are the name of the symbols in the symbol table, and the values are references to the symbol itself. The tied bit of magic allows changes in the actual symbol table to be reflected as changes in the tied hash. Tieing also allows assignments to the hash to translate into assignments into perl's actual symbol table.SYNOPSIS use Symbol::Table; # constructor takes two arguments, # which TYPE of symbols (PACKAGE,CODE,SCALAR,ARRAY,HASH) # and what package namespace do you wish to examine # the return value is a symbol table object. my $st_pkg = Symbol::Table->New('PACKAGE', 'main'); # the keys to a PACKAGE type symbol table are all the # sub packages under the objects namespace. # For all other types, the keys are the names of the # symbols (of that TYPE) in the objects namespace. foreach my $subpkg (keys(%$st_pkg)) { print "package main contains package '$subpkg' "; } Requirements: · Perl


Symbol::Table Related Software