Before Perl, there was no scripting language that could do systems tasks except maybe shell and tcl, but that's shell is an extremely unpleasant programming experience and the performance is horrid, and tcl's string-based nature is just too weird.
Perl gives you something more like a real programming language and can do shell-like tasks and systems tasks very nicely. Compared to what came before, it is amazing.
But then Ruby and Python came along and checked the "real programming language" box even more firmly than Perl while retaining the shell/systems angle. Ruby and Python were better than Perl along exactly the same axis as the one on which Perl was better than Tcl and shell.
IMHO Python killed both Perl and Ruby. While Ruby is more alive than Perl it's nowhere near as popular as Python.
I like Perl and used it professionally for year and vaguely remember probably around 2010x relatively massive Python evangelism (lots of articles, conferences, lots of messages from Python adepts on forums e.t.c). One of talking points (no longer needed nowadays) was that Python is backed (sponsored) by Google so Python will be successful and you should not worry about it's future and also if you will choose Python you will be successful (as Google is).
I think Ruby has declined because Rails was its selling point, but Rails was optimized for the world of HTML templates. Once you're writing JavaScript-heavy frontends and mobile apps, Rails isn't giving you much that you can't get from Python or server-side JS.
A few people started using Ruby for command line tools[1] but the community was very focuses around rails. Also Ruby isn't usually part of the standard OS install. So Ruby stayed stuck in it's Rails niche.
For me, this is why python took off. People wanted that lucrative job or receive the reflected glory of a winner, so y'gotta learn python. The rest is just post-hoc justification for why you made that choice passed on as "this language is better because of blah..."
A lot of the justifications don't stack up against serious scrutiny, but are accepted as gospel.
In previous life, worked on large object-oriented Perl. There was a difference between good Perl and the Perl in messy scripts. Good Perl was nice to work in but required discipline to keep organized.
I wonder if there was an earlier point of Perl's demise. Perl 5 came out with flexible object-oriented features, but it took years for packages like Moose to come out and make it nice and usable.
I always thought one of the best and worst things about Perl was the fact that you could build something like Moose with it.
But the bad side was that by the time someone was clever enough to invent Moose, all sorts of other bespoke object systems had been invented and used in the meantime, and your CPAN dependencies used every single one of them.
Good luck getting any two people to agree on a sharp line between programming language and scripting language. Perl seems to swap sides depending on the year people are arguing about it.
Entire enterprises ran/still run on Business BASIC and Delphi code. Billion-dollar fortunes have been made on such code. Those languages are used for serious things all the time.
Before Perl, there was no scripting language that could do systems tasks except maybe shell and tcl, but that's shell is an extremely unpleasant programming experience and the performance is horrid, and tcl's string-based nature is just too weird.
Perl gives you something more like a real programming language and can do shell-like tasks and systems tasks very nicely. Compared to what came before, it is amazing.
But then Ruby and Python came along and checked the "real programming language" box even more firmly than Perl while retaining the shell/systems angle. Ruby and Python were better than Perl along exactly the same axis as the one on which Perl was better than Tcl and shell.