Chapter 2. Using Modules
The killer feature of Perl is the Comprehensive Perl Archive Network, which we just call CPAN. Perl already comes with many modules, but there are many more third-party modules available from CPAN. If we have a problem to solve or a task to complete with Perl, there’s probably a module on CPAN that will help us. An effective Perl programmer is the one who uses CPAN wisely. We covered this briefly in Learning Perl, but we’ll cover it again here. It’s that important.
Modules are the building blocks for our programs. They can provide reusable subroutines, variables, and even object-oriented classes. On our way to building our own modules, we’ll show some of those you might be interested in. We’ll also look at the basics of using modules that others have already written.
As we noted in Learning Perl, we don’t have to understand everything about modules and how they work on the inside to use them (although by the end of this book you should know much more about that). By following the examples in the module documentation, we can still get quite a bit done. To jump-start our Perl, we’ll start to use Perl modules right away even though we explain their mechanics and special syntax later.
The Standard Distribution
Perl comes with many of the popular modules already. Indeed, most of the ...