Chapter 8. Standard Modules

We’ve talked about the extent to which Perl benefits from user contributions. In fact, many contributed modules are so generally useful that they are now distributed with Perl itself. This chapter describes these “standard modules"-if you are running Perl 5.005, all these modules are already available to you. If you are running an earlier version of Perl, and you find that a module you want isn’t on your system, or if you simply don’t find what you need among the modules in this chapter, check CPAN for one that does what you want.

While this chapter primarily covers standard Perl modules called at execution time from your program, it also covers the “pragmatic” modules that affect the compilation phase. (A pragma is a compiler directive that provides hints to the compiler.) By convention, the names of the pragmatic modules are all lowercase, while the names of other modules begin with an uppercase letter and are of mixed case.

The Win32-specific modules are not included in this chapter, but are described in Chapter 19.

The following table provides a quick look at the standard modules and what they do:

ModuleFunction
AnyDBM_File

Provides framework for multiple DBMs

attrs

Sets or gets attributes of a subroutine

AutoLoader

Loads functions only on demand

AutoSplit

Splits a module for autoloading

autouse

Postpones load of modules until a function is used

B

Perl compiler and tools

base

Establishes IS-A relationship with base class at compile time

Benchmark

Checks ...

Get Perl in a Nutshell 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.