serious question: What good is perl in 2024.
Follow up: where do you see it going.
Full disclosure: never implemented anything useful in perl in my personal or professional capacity for the last decade, except for debugging a few scripts here and there.
Perl is a Turing-complete language that runs on any platform and has maybe the longest-standing repository of open-source libraries. I haven't seen a benchmark recently, but I'd bet it still outperforms Python or node. But yeah, you'd be laughed out of any job for suggesting it be used for any serious work. It lost the PR war years ago.
I used it as my primary language for several years and it's extremely capable and intuitive. The learning curve of it's syntax is really only slightly longer than any other language. And I have the very strong opinion that syntax contributes less than 5% of readability and the rest is up to the developer to factor smartly and name things well.
To be fair neither node nor python are where they are today because of their performance.
I wish we could leave them behind as a fun phase of mass adoption of programming and fully switch to strongly typed languages alone. One can dream.
As much as I enjoyed Perl, I also cannot fathom how these kind of languages got so much adoption. For me, productivity is most strongly correlated with IDE support, debuggers and documentation. These are the kind of things Java and C# beat everyone else at. But it seems like a lot of devs are just dogmatically tied to their text editors.
"cannot fathom how these kind of languages got so much adoption"
The other options built into your UNIX (maybe Linux) machine were:
- C
- C++
- tcsh/ksh/bash
- awk
- TCL
What would you have chosen?
Apart from Python, even today what are the options?
golang/rust/c doesn't fit well the kind of tasks you would use Perl to do. There is simply too much verbosity and at some point in time you will bail out of the sisyphean nature of the task. Kotlin etc are more for mobile apps.
To me, back end work is-
1. Any serious application, that needs to run for years with performance - Java.
2. Glue work- Python/Perl.
I wouldn't dismiss Go that quickly, and same for C#.
Yeah, many people are happy with their IDE not letting them do something incorrectly (if they have extensions X, Y, Z installed), I prefer having something incorrect being impossible to exist.
correct vs. incorrect encompasses so much more than memory safety and types that agree. You could spend a ton of time making the ADA or Rust compiler happy only to discover your program doesn't solve the problem your customers want solved. That's why Python is still so very popular
A lot of the "dogmatically tied" comes from experience; it's why the common refrain is that IDE means "It Doesn't Exist" (where you have to fix the code). E.G. a "this is why we can't have nice things" situation.
This is why a lot of us still use vi/emacs; it's just what's available where we have to fix the problems.
I'll give you an example. I used to contract with booking.com, where they gave us a crippled little windows "amazon workspace" over vnc which we had to use to talk to their systems. They're transitioning from a perl shop into a java one, so naturally they use an IDE. Unfortunately, they have configured this little workspace such that SSH mounting your dev VM into an IDE isn't possible (due to it not having a workable ssh agent), and you can't install anything not pre-approved (so x11 forwarding a locally installed IDE is right out).
Minor changes could have been made to these workspaces to address this; requests for which went ignored for years.
The only thing I could rely on was what I am used to writing perl in. An SSH console session with vim and tmux.
I was quite glad to have java experience from before the days when java IDEs were any good. I'd have been screwed if I didn't know how to use the debugger and javac directly.
We've all had to work with our hands tied behind our backs often enough we just "skip to the end" and use the tools we know for a fact will always be available.
It's probably that same reason that perl persists to the level of popularity it has. Like vi, I know it's going to be there on basically any server I have to work on, and the client probably doesn't care/want or even know how to provision me something less primitive.
Perl has a very strong documentation culture. One of the things I miss in Common Lisp is the ability to just do 'perldoc List::Util' and get an overview of all subroutines in that module, with examples and clear explanations of how it all works.
I am reasonably sure Rentrak in Portland still uses Perl.
Agree! I will add that it's actually very possible to write Perl in a readable way (at least no more unreadable than your average bash or python script). It's all up to the developer to write readable, maintainable code instead of trying to impress themselves with their esoteric one-liners.
With the light syntax and giant, well-documented community repos, it feels a lot like Python With References to me, which is honestly pretty great imo. I wish more people respected Perl.
I think the old comment by Larry Wall about “manipulexity” vs “whipuptitude” still holds true. Perl occupies a powerful ecological niche in the space of programming languages. The space has become more crowded over the years, but it's still hard to beat Perl if you're experienced with it. CPAN is a big part of this.
As to the future... Perl 7 is coming (:
https://www.perl.com/article/announcing-perl-7/
Looks like that plan was abandoned: https://blogs.perl.org/users/psc/2022/05/what-happened-to-pe...
perl developer community found this probably isn't good ideas, so they decided to keep this version number for some important updates. maybe after the experiment end of "class feature" in newest version.
Making Debian possible. Allegedly, the German banking system is held together by Perl scripts. Which is good. Perl got 0 bitrot. And you don't want your bank account to rot, do you?
leftpad not found. Your fortune has been deleted.
I only use it as an alternative to a stream of awk/grep/sed/...
Usually much more concise, readable and faster.
I use it for in-place search and replace within files.
perl -pi -e 's/change this/into this/g' filename(s)
-p assumes an input loop around your script. Lines are printed.
-i in-place editing of files
-e may be used to enter a single line of script. Multiple -e commands may be given to build up a multiline script.
Combined with "find" with -exec and/or pipe the filenames into xargs and you can do a global search and replace across a whole tree of files.
I make my entire living modernizing various firms' perl stacks.
There is a never-ending amount of work for people who are good at modernizing older mod_perl/cgi stacks into psgi, and profiling/optimizing stuff.
Where I see perl going:
I see the big firms running away from it as fast as they can, and getting pikachu face when they inevitably get second-system effect, but nevertheless doubling down, because admitting failure is a no-no unless during a reorg.
I see the mittlestand and small biz expanding their existing use of perl, as they cannot afford to re-tool. Perl programmers will continue to have active careers for another 20 years, which is at least as long as I need to remain employed.
The language itself will continue to evolve at a snails' pace due to being design-by-committee since our BDFL retired. Thankfully this doesn't seem to be a particularly serious problem, as no advances in programming language design have come forth which are the kind of quantum leap in either dev productivity or performance to matter for our use cases.
I learned Perl in or around 1996; and it continues to work well for practical extraction and rubbish listing.
I've used Python when it was convenient, but I dislike it. So Perl remains my go to when I need to process data for more than a shell script.
Things I've written in Perl that I've run recently (or are croned so they run frequently) include: scripts to monitor shared directories for changes (kqueue) and publish the changes to a remote server so my spouse can drop images or other files to be shared on a share and get a link to send, or edit a recipe and check it from the web while shopping; my monitoring script that checks if my computers are working and emails me if not, it also reboots my dsl modem when it needs it; (for work) a tool to grab stats files from production, compute a summary, and then upload it so clients can be routed to the servers that are best for them.
I've done all sorts of stuff with Perl in the past, it's a very capable language.
I'm sure there are a few professional applications that support Perl, but the one that comes to mind is Radiator.
https://radiatorsoftware.com/
My understanding is that Perl is still somewhat popular in the sysadmin world - where just being able to push code that works is valuable.
You can be certain that a Perl program will still work unchanged in 2034. And it’s probably not going anywhere, both in the good sense and the bad sense.
After over a decade of programming in various more and less popular languages, I became a manager. I no longer had time to write real code but I needed to be able to automate things still, so I learned Perl.
Then I discovered one of Perl's best kept secrets: it allows you to write real code, if you want to.
Now I'm back to being a regular programmer again but I just happen to be more productive with Perl than anything else.
I have written about it before[1] but it boils down to one thing: it runs anywhere with no modification or installation, even 20 years from now.
[1]: https://two-wrongs.com/why-perl.html
Perl is flexible and cool while Python is for dorks and rules nerding losers. nasally voice huehuehue required indentation.
Pretty much anything that has to run on Unix(or unix like machines). Its special niche is glue code and automation related work. Use case for that happens quite frequently than one imagines.
There is a also a 'blub' nature to it as well. Many times unless you have used a tool, it can be hard to see what use case it fits in. Last two weeks I had to do a fairly heavy automation related thing at work. Bash was not suitable because the code would get big as the situation evolved. The tool has to be something using which is present everywhere(rules out things like golang, java), something in which you can rapidly prototype, something that is very good at manipulating text and something that works very well with Linux utils(Rules out python, golang). Over two weeks its size grew to something like 3K lines, and I have used it to automate hours of boring manual work, overall I think I ran it like 30 times or so.
Perl is also good at generating text which has some structure. So I have used in the past like a macro utility in languages that don't have macros. Basically I generate code using Perl. I have used this to generate python, pig and even java code many times.
Other types of work are for glue, like cron scripts, clean up, regular test scripts, rapid prototyping etc.
CPAN makes the whole experience awesome. Its still the fastest evolving library base compared to any language, only competition may be is js. You will find a library for nearly anything you want. And for something that you can't find, Perl is good at rapid prototyping. Compare this with something like Clojure, where even language goes without maintenance for months. Perl is still actively developed.
Another big factor can be commitment to backwards compatibility, you can be sure your scripts from years back will run on newer versions of Perl.
Perl is here to stay. Its installed on nearly every machine you can put your hands on, and even teams don't use it, Over the years I have seen individuals use it as some sort of a personal automation and productivity language. Like a secret tool.
I guess a lot of banks, telecommunications, manufacturing and early internet companies use it heavily till date.
Basically so as long need for automation exists, Perl would exist.
FastMail runs on Perl: https://blogs.perl.org/users/neilb/2019/09/fastmail-and-perl...
As Larry Wall said, Perl makes easy things easy and hard things possible. Almost the entire backend of my telecoms employer is written in Perl, and as a result of sticking with it we have a code base which is lean and runs fast and efficiently. Both of these are strong benefits that I'll always defend as far more important than people are willing to admit.
I don't see Perl going anywhere. Neither back towards popularity, nor further into obscurity.
I've found that I can most easily express myself in Perl. I love the feeling that you can never truly exhaust the language. I hated the indentation at gunpoint and overall sterility of Python, and JavaScript is much more disjointed than what anyone imagines Perl to be.
My most recent task using it was writing a backup script that connects to various systems, archives stuff, then copies it to a NAS and then updates a backup log.
Before that I created a demo site for a business idea using Mojolicious (Perl web framework) + DBIx::Class (Perl ORM), and I believe we could have completed the project using them. But due to concerns that we couldn't find or pay Perl programmers when we scale we abandoned it for a rewrite in C#/ASP.NET. A heart vs mind decision, but business needs came first. I'm aware that I'm the only one of my age (early 30s) in my circles who has learnt Perl.
And that previous sentence is why I fear for its future.
A few years ago I used it do to a KeyPass migration, because the KeyPass libraries in every other language didn't work.
I wrote a different Perl script as a Sysadmin 20 years ago and used it last year. Still works.
Another time I was doing something and wanted to grok some horrid DSL (cough HCL cough) and in 20 minutes wrote a script to parse thousands of files give me what I wanted. Still use that script.
Where's it going? No idea, don't care, I'll probably keep using it for the next 25 years.