B.4. Extending Perl's Functionality
One of the most common pieces of good advice heard in the Perl discussion forums is that you shouldn't reinvent the wheel. Other folks have written code you can put to use. The most frequent way to add to what Perl can do is by using a library or module. Many come with Perl and others are available from CPAN. You can even write your own libraries and modules.
Many programming languages offer support for libraries much as Perl does. Libraries are collections of (mostly) subroutines for a given purpose. In modern Perl, though, it's more common to use modules than libraries.
A module is a "smart library." A module will typically offer a collection of subroutines that act as if they were built-in functions, for the most part. Modules are smart in that they keep their details in a separate package, only importing what you request. This keeps a module from stomping on your code's symbols.
Though many useful modules are written in pure Perl, others are written using a language like C. For example, the MD5 algorithm is like a high-powered checksum.[*] It uses a lot of low-level bit twiddling that could be done in Perl but hundreds of times more slowly; its an algorithm that was designed to be efficiently implemented in C. So, the Digest::MD5 module is made to use the compiled C code. When you use that module, it's as if your Perl had a built-in function to calculate MD5 digests.