Picking Perl for the Right Reasons

The Perl Journal February, 2004


Like a lot of us, I have to defend Perl from those who have come to the conclusion that Perl is somehow passé. I suspect this happens to all languages at some point in their lifetime, especially once they reach a stage of maturity where revolutionary leaps and bounds don't occur with every new release. There seems to be an assumption that if it's no longer in the headlines, it must be dying.

The most disturbing questions are the ones I get from project leaders who have a Perl project planned, but are getting heat from IT execs who have paid consultants to tell them that Perl is out of date. Did we all just switch to the fashion industry? Since when is it a good idea to pick your development tools based on what's "hot"? You pick the tool based on how well it accomplishes the job at hand.

I'm not saying Perl is the perfect tool for every job, although there's a good reason it has been called a "Swiss army knife." If you want to prototype a complex GUI, for example, Perl might not be the best choice. (I know some of you will disagree, but it wouldn't be my first choice.) But if you have textual data to massage or web functionality to build, Perl is a very strong contender, due in no small part to the huge library of preinvented wheels out there that Perl programmers can choose from. If you need to extract and report, then for goodness' sake use the language that was built for extraction and reporting.

I wish IT executive types would take their FUD with a grain of salt. Is Perl less popular than it was? I think that depends on how you measure it. The number of new people adopting Perl may be decreasing, but decreased growth is still growth. And what does that have to do with getting a project finished? If someone makes a case that Perl is going to limit a project in some way, then listen to their case. But none of us wants to work in a company that makes language choices based on the buzzword of the day. That's a Dilbert cartoon come horribly, frighteningly true.

Sometimes, it seems that Perl moves too slowly. By the time Perl got object-oriented features, we were good and ready for them. But the reason that Perl wasn't the first language to go OO is the same reason that it probably won't be the first language to adopt any other new methodology. I'm talking about what the letter "P" in Perl stands for: practical. Above all, it must remain easy to do easy things. And it's not always easy to keep sight of that principle while adding new features to a language. If, for instance, we have to instantiate a class just to do a quick pattern-match substitution, then I think it's fair to say we've lost some practicality. Thankfully, that hasn't happened with Perl. Perl has abstraction when we need it, and a complete lack of abstraction when we don't.

Maybe Perl gets shortchanged for some sort of perceived obsolescence. Frankly, I think reports of its demise have been greatly exaggerated.

Kevin Carlson
Executive Editor
The Perl Journal