Why is Perl installed by default with most Linux distributions?
The answer is/isn't sexy, depending on your point of view.
Perl is very useful. Lots of the system utilities are written in or depend on perl. Most systems won't operate properly if Perl is uninstalled.
A few years ago FreeBSD went through a lot of effort to remove Perl as a dependency for the base system. It wasn't an easy task.
In Larry Wall's original Perl v1.0 posting to the comp.sources.misc newsgroup on December 18, 1987, he said:
If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their capabilities or must run a little faster, and you don't want to write the silly thing in C, then perl may be for you.
In a much later exposition, he elaborated a little more:
But the frustrations of Unix shell programming led directly to the creation of Perl, which I don't really have time to tell. But essentially, I found that shell scripting was intrinsically limited by the fact that most of its verbs are not under its control and hence largely inconsistent with each other. And the nouns are impoverished, restricted to strings and files, with who-knows-what typology...
More destructive was the mindset that it was a one-dimensional universe: you either programmed in C or you programmed in shell, because they're obviously at opposite ends of the One True Continuum. Perl came about when I realized that scripting did not always have to viewed as the opposite of programming, but that a single language could be pretty good for both. That opened up a huge ecological niche. Many of you have seen my old clamshell diagram, with the two dimensions of manipulexity and whipuptitude.
Today, Perl is a standard alternative/replacement for shell-scripting and text parsing needs, and with much more power than the traditional tools. Because of it's extreme (some would say inelegant) flexibility, Perl has been described as "the Swiss Army chainsaw of scripting languages". Tasks can often be significantly shorter, easier, or more extensible when solved with Perl. Many, many system tools, scripts and larger programs are routinely written in Perl. So in the modern Linux environment, Perl is now another standard Unix tool, and truly indispensable.
- Perl was developed for Unix because the tools were not powerful enough. For sports, you can look for
awk
andsed
in it (Perl). - Perl was (among other things) inspired by the Unix shell (and C, which is very important to Unix -- or the other way around, perhaps).
- Also, Perl can be distributed under a GNU license. Some people would consider that irrelevant from a technical standpoint, but it shows the intermingling.
- The last thing I can think of is LAMP, which is a networking "software bundle". (Check it out on Wikipedia: the P is, or at least was, Perl; the L is Linux.) (But this last point is a bit "chicken or egg".)