Introduction
“Perl” can mean different things to different people, but based on this unique spelling, it can only mean one thing:
Practical Extraction and Report Language
It is Larry Wall’s scripting language, primarily developed for UNIX based operating systems. However, ActiveState maintains a Windows port, which I use on a regular basis:
http://www.activestate.com/Products/activeperl/index.mhtml
Perl was originally designed to be a superset, an amalgamation of Larry’s favorite scripting languages. Consequently, it is an extremely rich language, because it borrows from so many. It is also designed to enable compact code. Consequently, it can be difficult to master and read (reverse-engineer). However, for the patient and determined, Perl provides a treasure trove of programming power.
Common Usages
Perl is primarily used for complex text processing. Although awk has been the traditional, simple text processor, Perl can compete well with awk. The primary deciding factor is, as always, your personal knowledge and proficiency in each language.
Perl is also used as a programming language for many dynamic web sites. It has been a favorite language for CGI scripts used in form processing and producing dynamic web-content. Recently, PHP has been overtaking Perl’s popularity on this scene, and even more recently, Ruby has been overtaking both, especially when considered with the “Ruby on Rails” extension. However, it seems like a new language appears on this front almost every day.
Although it cannot match the flexibility or speed of C or C++, Perl can be used as a complete language for very complex projects. It provides object-oriented support. And, it has a large developer community, providing hundreds of varied and tested third-party modules. Exploring and utilizing these modules are key to unlocking the latent potential of Perl. Many modules are stored and documented on CPAN:
For example, these modules allow you to edit MP3 tags, parse or write XML files, generate PNG image files, etc. They handle many of the low-level details, which would require a large amount of time to reproduce. Why reinvent the wheel, especially if you can download a free set with racing stripes and turbo pre-installed?
Why Perl?
Is Perl perfect? No way! But, it offers a tremendous amount of immediate power on multiple platforms (UNIX, Linux, Windows, etc.). It is much easier to develop simple programs in Perl than C, C++, JAVA, or other more “powerful” languages. Admittedly, Perl has its quirks. But, unless you are a C.S. or C.S.E. student with copious amounts of free time and interest, it is difficult to keep up with the latest scripting language craze, which may or may not be more powerful than the language you already know. At some point, mastery in one language becomes more powerful than mere acquaintance with several. So, here in the real world, I have thrown my lot in with Perl, although I hope to someday learn more about Python or PHP, while I use C for “real” work.
One of Perl’s idiosynchrocies is that it tries to help you by doing several things automatically for you “behind the scenes”. Given this fact, its diverse blending of languages, and its compact notation, Perl has an inevitable steep learning curve and a rapid “decay rate”. You have to use Perl regularly and routinely to learn, master, and maintain a working knowledge of Perl. Unfortunately, I don’t use Perl that regularly in my day job, so one of the categories on this web-site will contain my notes on tips and tricks in Perl. Hopefully, my own knowledge of Perl won’t atrophy so rapidly, and I will be able to find details on accomplishing infrequent, but necessary tasks without having to search through mountains of old scripts and code. Who knows? Maybe you will find something helpful here too!