© William "Bo" Rothwell of One Course Source, Inc. 2020
W. ". RothwellAdvanced Perl Programminghttps://doi.org/10.1007/978-1-4842-5863-7_8

8. Building Modules

William “Bo” Rothwell1 
(1)
El Cajon, CA, USA
 

The purpose behind Perl modules is to create code that can be loaded into another Perl script. This technique is often referred to as creating a library.

Perl modules consist of a set of related functions. By itself, a Perl module doesn’t "do" anything. By calling a Perl module, your script will have access to additional functions and variables.

Some general guidelines for modules:
  • The filename’s extension should be ".pm".

  • All identifiers in your module should be placed in a separate package (not main) to avoid the possibility of overwriting existing ...

Get Advanced Perl Programming: From Advanced to Expert now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.