Perl

Like many Linux and Macintosh fans, devotees of Perl love their technology and defend the language passionately.

Case in point: One major Perl user group doesn't refer to its members as "users" or even "advocates." Instead, it calls them "Perl Mongers."

"Perl attracts people because it's full of nooks and crannies," says Jon Orwant, editor of The Perl Journal and a member of the Perl Mongers advisory board. "The motto is, 'There's more than one way to do it,' and the language allows a creative writing approach. There's always room to learn about neat new ways to do something."

Perl is also a good choice for speedy application development, advocates say.

Small but Complete

Initially developed by Larry Wall in 1987 to automate some Unix administration tasks, Perl has become a popular environment for creating a wide range of applications. It's relatively easy to write small scripts for simple tasks, but the language is powerful enough to satisfy top-notch code jocks.

"Other languages strive to be elegant or very small; Perl strives to be complete and easy to use," wrote Paul Hoffman in Perl for Dummies (Hungry Minds Inc., 2000).

Because Wall solicited contributions from programmers worldwide for both the open-source code and add-on modules, Perl has capabilities far beyond its systems administration roots. It has a robust debugging environment, and its modules aid tasks such as processing HTML and XML data.

Perl includes object-oriented capabilities, which many IT teams prefer for multiperson development projects. However, programmers working on simpler tasks don't need to use objects, and thus the language is useful for both sophisticated Web e-commerce tasks and simple data manipulation.

Perl is one of the most popular languages for creating Web applications-Amazon.com Inc. is among the many well-known Perl users-as well as for developing front-end access to databases and network services. "Most of the Fortune 500 uses Perl," Orwant says.

Many developers still consider Perl an ideal environment for reading, analyzing, manipulating and storing text files. In fact, Perl stands for Practical Extraction and Reporting Language, although the full name is seldom used anymore. To some IT organizations, Perl is attractive when compared with competing technologies because it has been around for a while, so experts have had plenty of time to fix bugs, stabilize the platform and find security holes. Its 14 years trump many other well-known open-source projects, such as Linux and the Apache Web server.

Adam Faust, Web administrator at the Knoxville-based Tennessee Valley Authority, recently used Perl to create a Common Gateway Interface for the power company's Web site. He says the Perl archive network and modules were able to tie in to both the TVA's Oracle database and its IBM WebSphere application server. "In a lot of cases, it's more mature than Java," Faust says.

Platforms Galore

There are ports of Perl source code to run in most major environments, including Unix, Windows, IBM's z/OS, OpenVMS, Novell Inc.'s NetWare and Macintosh. There's even a version for Windows CE, although there's no port yet for Palm OS. Perl isn't considered an ideal choice for things such as embedded applications because of its relatively large memory footprint, notes Orwant.

Advocates of other, more specialized languages also say that Perl's general-purpose flexibility can make it a bit more cumbersome for certain tasks than more targeted languages.

For example, some users of the open-source scripting language PHP say it's easier to develop dynamic Web applications in PHP than in Perl; PHP has some Web functions built in that Perl requires modules to perform. However, many who develop their Web pages in PHP still turn to Perl for other back-end functions.

Perl source code is available for download at no charge from the Comprehensive Perl Archive Network at www.cpan.org, along with numerous modules.

Data Sorting Using Perl
This code opens a text file, sorts the lines of data alphabetically and stores the sorted data in a new file:

open (ORIGFILE,
“unsorted.txt”);
open (FINALFILE, “>sorted.txt”);
print FINALFILE
sort(<ORIGFILE>);
close (FINALFILE);
close (ORIGFILE);
Points of View
PROS
Powerful
Flexible
Relatively easy to learn
Allows quick application development
CONS
Sometimes eclectic syntax
Large memory footprint
Can be more cumbersome for some tasks than more specialized languages

Join the newsletter!

Error: Please check your email address.

More about Amazon.comApacheHungry MindsIBM AustraliaNovell

Show Comments

Market Place