IN-DEPTH
Perl at 34
Jonni Bidwell tries not to cut himself on the “Swiss army chainsaw” of programming languages, Perl.
P
erl is a language that today is all-too-often overlooked. Its creator Larry Wall was making open source software long before the phrase had entered the common parlance. He wrote the popular
rn
newsgroup reader for Unix terminals, and then to update it, wrote a helper program called
patch.
That tool (which uses a list of differences between two files to transform one into the other) became fundamental to software development on Linux.
In
Perl, the first postmodern computer language
(see www.wall.org/~larry/pm. html) Larry described how both Perl and Linux were deserving of the PoMo monicker. Both were open source, borrowed heavily from Unix and required
“a lot of people who think programming is serious fun”.
So we figured Perl, its history, its developers and its community were long overdue some time and space. Before there were dev-ops and The Cloud, system administrators were crafting Perl scripts to do things too complicated for a conventional shell. Era-defining websites such as SlashDot, the IMDB and Yahoo! (most of which are still useful today) all leveraged Perl’s flexibility and power of expression. Perl is a language that excels at text processing. Regular Expressions (regexes, the powerful pattern-matching punctuation that confounds so many who attempt to learn its ways) enable complicated functions to be carried out quickly on strings. Regexes could be done from the shell using sed, grep and awk, but all these tools are subject to arbitrary limitations imposed by the shell. Perl achieved them much faster, and since Perl had been ported to other platforms it obviated compatibility issues across shells and architectures.
We’ve been guilty of mocking the time taken to effect the transition from Python 2 to Python 3. But our predecessors were mocking Perl 6’s long development time as early as 2005. “It’ll be ready when it’s ready,” Larry assured our impatient reporter. Time makes fools of us all, then. Python 3 has been adopted by most major distributions, and Perl 6 (now named Raku) is real. We’ll see that Raku isn’t a successor to Perl 5 so much as a sibling, and that Perl 5 isn’t going anywhere.
Back in LXF75 we interviewed Larry Wall, creator of the Perl language. He was excited about the release of Perl 6, first announced in 2000. More on that later – first let’s see the scene. Larry has a background in linguistics, which has endowed Perl with qualities of intuitiveness, quirkiness and power. Perl has pronouns, for example $_ means ‘it’ and @_ usually means ‘them’. It has a special function for erroring on bad input ( croak() ). Wall has even said he considers #!/usr/bin/perl might correspond to ‘Once upon a time’ and __END__ to ‘and they lived happily ever’. There’s also a whole world of Perl poetry. Fans of Poe are well advised to study the macarbre verse Black Perl, which was anonymously sent to the comp.lang.perl newsgroup in 1990. Like common magick, Perl has sigils, too. These punctuative characters that precede variable names change their meaning depending on the context.