I don’t think the problems with Perl are that it has a lack of features like this article seems to imply… I have some older scripts at work that no one can read (or is unwilling to look into the abyss) from a decade ago but are mission critical. This isn’t one-off, it’s like that with almost all of the Perl code. I think we just have better languages, with better, more readable expressiveness where Perl isn’t needed anymore, in the same way that I don’t see people script in Lisp in real-world codebases.
Programming languages never die; they slowly fade away.
This article got me wondering if I should try out Perl for Advent of Code this year.
The sheer number of odd corners to the language gives me pause, though, especially things like scalar vs list context and typeglobs or how references are such a special case around arrays.
A lot of strange cruft around things that feels like an alternative universe of language design.
I’ve participated in every AoC using Perl and enjoyed it a lot. However, I don’t believe AoC is the best way to get to know Perl. Perl’s real strengths are as a glue language - slinging files, accessing databases, producing stuff like reports and web pages (this is not something unique to Perl of course, lots of languages are good at this).
Puzzles like AoC are fun but they mainly teach how to solve puzzles, not languages.
Weird stuff like @_ was why I bounced off Perl years ago. Nice to see they modernized it some but it’s too late to get my interest when bash and python are right there.
@_ feels like the least strange of the strange parts about Perl, I can kinda understand where it might come from. Last time I looked into Perl was in 5ish years ago in college, and Typeglobs bounced me right of with “why would I want to bind the same name so many times?”
Every time someone brings up a language, including talking about how some old language now has features the ‘cool’ language had last decade, I just want the summary:
What are the coolest things about this language?
For what type of programs is this language best?
In old Perl, the coolest feature would be the speed an experienced author could slam out code. Readability, maintainability, and consistency took second place to this goal. The old joke was that you would never find the last bug in a Perl program. It got your prototype to market really, really fast. There were other coolness items that have since become common such as repositories and database cursors as file handles.
Perl was for prototyping complex web services in a tearing hurry.
Is there something else?
Is there something else?
PCRE which pretty much all mainstream languages incorporated in some form or other.
I’d assume other than shells Perl is among the most portable scripting languages and that is old enough to have an extremely robust ecosystem and libraries. That’s true for all old languages too I guess. Oh on portability, what was special with Perl is that they have (had?) something where you could just randomly run test suites of libraries on a machine, which caused libraries to be tested on super obscure systems. In other words, it wasn’t just the language that was very cross-platform, but also the libraries you’d find on CPAN. Nowadays it’s a bit annoying to often find software that only works on Ubuntu, maybe only one version of it. Docker certainly hasn’t made that better.
It’s really good for golf and really nice for running Perl scripts as one-liners on the command line. With -M and -e arguments if I remember.
I kind of expect that it’s still the fastest language to build a prototype of pretty much anything in, if you know it well.
But that’s just from someone who hasn’t touched Perl in decades, so I might be misremembering some parts.