| Start |
|---|
Using a module This will import the Generally this is will do the right thing. Sometimes, however, you will want to control which symbols are imported. Add a list of symbols after the module name to export: If you do this, only the symbols you specify will be imported (ie, the default set will not be imported). When importing multiple symbols, it is idiomatic to use the Some modules export a subset of their symbols, but can be told to export everything with (Note that not all modules recognize or use the |
Loading a module at runtime This will ensure that the N.B.: Most users should This way of loading modules is useful if you can't decide what modules you need before runtime, such as with a plugin system: This would try to load |
Using a module inside a directory
If you want, you can group as many modules of your own inside a single directory and make them findable with one At this point, using the subroutines in the module will require prefixing the subroutine name with the package name: To be able to use the subroutines without the prefix, you need to export the subroutine names so that they are recognised by the program calling them. Exporting can be set up to be automatic, thus: Then in the file that Or you can set up the module to conditionally export subroutines, thus: In which case, you need to explicitly request the desired subroutines to be exported in the script that |
Executing the contents of another file This will read in the contents of the config.pl file and execute it. (See also: N.B.: Avoid |
| CPAN.pm
It supports interactive mode invoked with or Querying modules By name: By a regex against module name: Note: to enable a pager or redirecting to a file use By distribution: Installing modules By name: By distribution: |
| List all installed modules From command line: From a Perl script: Syntax
|
Read Article
https://develop.horje.com/learn/1434/reference