Perl Module

From GM-RKB
Jump to navigation Jump to search

A Perl Module is a software code module that is in perl code.



Notes

  foreach $symbol_name (sort keys %TGQueryDataMgmt::) {
     local *local_sym = $TGQueryDataMgmt::{$symbol_name};
     print "\$$symbol_name is defined\n"                  if($local_sym);
     print "\@$symbol_name is defined\n"                  if(@local_sym);
     print "\%$symbol_name is defined\n"                  if(%sym);
}

References

2011

  • http://perldoc.perl.org/perlmod.html
    • QUOTE: Perl provides a mechanism for alternative namespaces to protect packages from stomping on each other's variables. In fact, there's really no such thing as a global variable in Perl. The package statement declares the compilation unit as being in the given namespace. The scope of the package declaration is from the declaration itself through the end of the enclosing block, eval, or file, whichever comes first (the same scope as the my() and local() operators).


  • http://perldoc.perl.org/perlmod.html#Perl-Modules
    • A module is just a set of related functions in a library file, i.e., a Perl package with the same name as the file. It is specifically designed to be reusable by other modules or programs. It may do this by providing a mechanism for exporting some of its symbols into the symbol table of any package using it, or it may function as a class definition and make its semantics available implicitly through method calls on the class and its objects, without explicitly exporting anything. Or it can do a little of both.