(no title)
franticgecko3 | 5 months ago
It's extremely stable, installed almost everywhere, and has much fewer insane idosyncrasies than shell.
I can write some Perl and confidently hand it to a colleague where it will almost certainly work on their machine.
It's a shame it's so dead, for a scripting language there's nothing else that ticks the same boxes.
I would never write systems software with it, of course
andrewl-hn|5 months ago
Perl is straight up better. You need to remember one word: pie - for it's command line options, and now you can do:
First of all, it woks the same way across platforms.Second, you get all sorts of goodies: named capture groups, lookahead and lookbehind matching, unicode, you can write multiline regexes using extended syntax if you do something complicated.
And finally, if your shell script needs some logic: functions, ifs, or loops, Perl is straight up better than Bash. Some of you will say "I'll do it in Python", and I agree. But if your script is mostly calling other tools like git, find, make, etc, then Perl like Bash can just call them in backticks instead of wrapping things into arrays and strings. It just reads better.
BTW Ruby can do it, too, so it's another good option.
nicwolff|5 months ago
tasty_freeze|5 months ago
We have many scripts that range from 5.8 to 5.36 and everything in between. 5.8 is 20 years old. Someone did a search & replace on the shebang lines to move all the older ones to 5.20 (why they picked that one, I don't know) and everything just continued to work.
I prefer perl over python. turn on use strict, use warnings FATAL => 'all' and use modern function signatures. Perl is still great for its purpose.
superkuh|5 months ago
The former is the consequence of the later. Popularity kills stability. Perl is the ultimate sysadmin language because it's so portable and never changes. We really lucked out with the Raku thing driving people away to python. Because of it my perl scripts I wrote in 2003 run on perl system interpreter today and the vast majority of my perl written today would run on a 2006 perl interpreter (some functions missing in some libs in troublemakers like Gtk bindings, etc), but it's generally very good.
These days with python you can't even run any random script written today on your system python from today. You have to set up an entire separate python for every script. And don't even think about trying to run a python script from 2006. That's what popularity does: fracture.
ktpsns|5 months ago
mmphosis|5 months ago
Romario77|5 months ago
I think Python ticks almost all the same boxes (and is much better designed in my opinion).
rurban|5 months ago
And you cannot just install a python module as you install a perl module. You need venv everything because it's soo fragile.
But this 10k sponsoring is not really worth mentioning. It's just like Platinum sponsorship for one of their conferences.