Perl LanguagePackages and modules


Syntax

  • require Module::Name; # Require by name from @INC
  • require "path/to/file.pm"; # Require by relative path from @INC
  • use Module::Name; # require and default import at BEGIN
  • use Module::Name (); # require and no import at BEGIN
  • use Module::Name (@ARGS); # require and import with args at BEGIN
  • use Module::Name VERSION; # require, version check, and default import at BEGIN
  • use Module::Name VERSION (); # require, version check, and no import at BEGIN
  • use Module::Name VERSION (@ARGS); # require, version check, import with args at BEGIN
  • do "path/to/file.pl"; # load and eval the given file