Perl is a powerful text processor, which is because of what it was first built to do, which was handling reports from NASA system administrators, but that’s not the limit of its uses. It’s particularly well-suited to graphics programming, system administration, network programming, programming CGI and projects that involve accessing a database. It’s flexible and adaptable, which is why Perl has picked up the delightful nickname, “The Swiss Army chainsaw of programming languages.”
The CPAN network
Programmers and admins choose Perl because of the numerous benefits that it brings. One of them is CPAN, the Comprehensive Perl Archive Network. Its library boasts more than 15,000 modules and scripts and divides them into 24 sections, according to their purpose. Most of these handy modules cost absolutely nothing, and the CPAN network makes itself doubly useful by automating the software installation process too.
CPAN has 260 mirrors spread across 60 countries. It varies from mirror to mirror, but these are often updated as frequently as daily and sometimes even hourly, so users are virtually guaranteed to always have the latest version of each.
Perl modules grant access to code held in external libraries, so that one file might contain routines that can also be found in many other programs. The Perl interpreter is always used to compile Perl modules, and these usually live in a number of sub-directories.
Perl modules come in two different styles, and each has advantages that it brings to different circumstances. When a module is made in the “exporting style” you are able to use the functions defined in it as your own. In contrast, with an object made in the “object-oriented style”, it will define a ‘class’ that knows how to build ‘objects’, and this can perform actions on behalf of the program when required. In Perl, an “object” simply means something that knows which class it belongs to.