Brain Candy #24 - Creating the Swiss Army Chainsaw

Brain Candy #24 - Creating the Swiss Army Chainsaw

One of the more interesting success stories of the Open Software movement is the computer language called Perl (aka "The Swiss Army Chainsaw"). Perl is an eclectic language, specifically created for task-solving power and programmer satisfaction. This is rather novel among modern program languages, which have usually been created to prove some computer science point or another. The user orientation of Perl is a direct result of the original creator of Perl, Larry Wall. I'll have more to say about him, shortly. But first, let me tell you about Perl.

Early programming languages (eg FORTRAN and COBOL) were practical in varying degrees, but given the incomplete knowledge of human factors in programming language design, the primitive state of computer science theory and the low power of the hardware of the time, they left much to be desired. That they are still in common use is a testament to their usefulness, even though they are ancient in computer terms.

C and C++ are the kings of modern computer languages. They are definitely practical languages, but they have steep learning curves. You need to expend a lot of effort to become a competent C/C++ programmer. C/C++ programs are also moderately verbose for a given amount of work. Stated differently, you have to type many programming statements to do relatively simple tasks.

Not everyone has the time required to become a professional programmer, but many computer users need to be able to perform relatively simple scripting tasks. Before Perl, there were languages that could do some jobs fairly well and could be forced to do other tasks (at the price of a lot of painful convoluted coding). Perl was designed to be able to do just about any kind of small- to medium-sized programming task that a user might otherwise have to do in C or C++. Perl doesn't just duplicate C's capabilities, it provides tools that greatly simplify such tasks.

If you've used the web, you've used Perl programs. Much of the dynamic content provided by web sites is written in Perl. There are many reasons for this; one is the previously mentioned human and task orientation of the language. But there are other reasons. Perl evolved in the UNIX programming environment, where the web started and Perl was available in the early days of the web. It has built-in security features that make secure web programming much less difficult. It's free and open (you can see and alter the source code) and available for just about any computer system in use today. Perl looks pretty much the same no matter what environment you use it in . When you work on many different platforms, that's a valuable advantage. Perl is powerful; you can write meaningful programs in a few lines of Perl that would take dozens of lines in other languages. Perl was designed to be very efficient as a text processing language; one of the meanings of the Perl acronym is Practical Extraction and Report Language. Since the web is mostly text, Perl is a natural match. It has a full array of tools for efficient slicing and dicing of files. I've written Perl code to convert old-style mark-up text documents to HTML in a few hours. The commercial equivalent, which probably worked no better than my program, cost $10,000. I could not have done this so quickly and so well in any other computer language.

One very great strength of Perl is that it provides you with many capabilities that you are free to use or ignore. It is both very broad and deep, but unlike most other modern languages, you can learn practical amounts of Perl very quickly. You don't need to know everything about Perl in all its depth before you can use it.

Another interesting quality of Perl is the huge amount of web-based help available. Here are a few major Perl URLs, which link to many others: www.perl.com, www.perl.org, language.perl.com, reference.perl.com and www.perlmonth.com (note: this link is now dead). There is a magazine devoted to Perl, "The Perl Journal", which is an invaluable resource. There are also many very good books on Perl. Most of these are published by the computer book publisher O'Reilly and Associates; their site is at www.oreilly.com and is quite interesting in its own right. The two best books for starting out are "Learning Perl" and "Learning Perl for Win32 Systems"; the former is more UNIX-oriented. Once you're grounded in Perl, the canonical reference book is "Programming Perl". All three of these are O'Reilly books. Once you've got these, there are many others to help you advance your Perl knowledge. The web sites above have reviews of the many Perl books now available.

When you visit Perl web sites, don't be intimidated if the material you find looks beyond you. If it doesn't make sense, you're not ready for it. That's ok. Seek out links to the tutorial sites (like www.scs.leeds.ac.uk/nik/) or start with one of the "Learning Perl" books. If you're ready to get started, to get the latest Win32 binaries, go to www.activestate.com/ActivePerl/. They install easily and have a very complete set of documentation, but it is intended for reference purposes, and is not all that helpful to beginners seeking to learn Perl. Make sure that any Perl binaries that you get are at least version 5.004; earlier versions lack various nice/necessary features that you'll want to have.

Actually, I'm not going to try to teach you any Perl here. The point behind this article is to show you how one motivated, intelligent individual, created something that changed the world. Perl was created, very deliberately, by Larry Wall. He saw a need very clearly, had the abilities to craft a solution, and shared it with the world. The World Wide Web, and therefore the entire world, would be very different without Perl.

Larry Wall turns out to be a very interesting person. He is a linguist by formal training, but he also has been involved in the physical sciences, music, religion, and philosophy and of course, computer science. All of these seem to have played a role in what Perl has become; his natural sense of humor and basic common sense also were very important and show up in the language and its documentation. To get a feel for what I'm talking about, take a look at one of the more interesting web pages I've ever read: www.perl.com/pace/pub/perldocs/1999/03/pm.html. It's the text of the talk Larry gave at the recent Linux conference, which he titled "Perl - the first post-modern computer language". It's full of insights about all sorts of things other than computer science and is worth reading even if you aren't interested in computer science. There are other talks and interviews with Larry available on the web, if you like his style. He has a web site at kiev.wall.org/~larry. Check out his "Natural Language Principles in Perl" for some of the design philosophy behind Perl. He presents some very interesting ideas there.

Larry created the first versions of Perl; after it began to circulate in the real world, others also contributed. These are also very intelligent, interesting and motivated people. Besides Larry, the two other Perl 'deities' (see www.geekcode.com) are Randal Schwartz and Tom Christiansen. Randal Schwartz has a very interesting site at www.stonehenge.com/merlyn/; he's a well-known, colorful, and even controversial character. He has links to every page on the web that links to his; there are hundreds, which attest to his renown. Tom Christiansen maintains www.perl.com, but he doesn't seem to put personal info on the web that I've been able to find. I've learned a lot about him from his contributions to the Perl USENET groups (another good source of information, by the way). There are many, many others who have shaped and molded what Perl has become and what it is becoming; don't hesitate to visit Perl developers' and users' pages when you find links to them. And don't forget what one person can do.

More Brain Candy | Back to Brain Candy Central | Return to the CATBAR Main Page.

CATBAR - Brain Candy #24 - Creating the Swiss Army Chainsaw / Brian Rock / December 6 1999