News for hackers. Stuff that matters.
Re:Not Your Grandfather’s Perl by stjohnswarts on Thursday September 08, 2022 @02:34PM (#32769949)
I would argue that ruby as almost all the strengths of perl and conciseness with more coherency if you want a perl-like fluidity and terseness. I personally like python for anything that becomes more than a 100 lines of bash.
Re:Not Your Grandfather’s Perl by btilly on Thursday September 08, 2022 @04:33PM (#32771709)
Due to poor coding practices (eg monkeypatching) and a weaker testing culture (by default Ruby does not run unit tests when installing libraries) I've found Ruby to be substantially less reliable than Perl.

However the world has moved on to Python. So I curse every time I again have to look up how subprocess works for what I'd do in Perl with backticks.

Re:Not Your Grandfather’s Perl by int_19h on Thursday September 08, 2022 @10:24PM (#32774580)
Re:Not Your Grandfather’s Perl by btilly on Thursday September 08, 2022 @10:52PM (#32774753)
The documentation for that says, "Specifically, Windows is not supported."

My use case was for scripting git operations. And the list of target environments included Windows.

So no, that wouldn't have worked for me.

Re:Not Your Grandfather’s Perl by cutler on Friday September 09, 2022 @01:19AM (#32775588)
To be fair to Python subprocess is not simply a substitute for backticks in Perl or Ruby. It's supposed to protect you from some of the more obscure problems which can happen with shell expansion.
Re:Not Your Grandfather’s Perl by thenipper on Thursday September 08, 2022 @11:16PM (#32774888)
Check out plumbum: https://plumbum.readthedocs.io/en/latest/

It supports mac, Linux and windows.

Re:Not Your Grandfather’s Perl by fomine3 on Thursday September 08, 2022 @11:53PM (#32775113)
TIL (as a light Perl user alternative to awk) CPAN runs test on install. Is there any other language package manager runs tests by default?
Re:Not Your Grandfather’s Perl by liveoneggs on Friday September 09, 2022 @08:52AM (#32778525)
that is super dangerous, just like some other dangerous parts of perl where it can run code during the compilation phase
Re:Not Your Grandfather’s Perl by btilly on Friday September 09, 2022 @10:26AM (#32779656)
A lot of languages allow the running of arbitrary code on install, so it is not particularly dangerous that Perl allowed it.

However you have no idea how many bugs got caught because the test run uncovered platform specific bugs. This is exactly what gave Perl a good name for being portable. Doubly so given that Perl always did this, starting back in the 1980s.

Re:Not Your Grandfather’s Perl by zaphar on Friday September 09, 2022 @12:58PM (#32781833)
Even better is cpan testers who will run your cpan package on the widest variety of platforms I have ever seen. To my knowledge no other package ecosystem will do this.
Re:Not Your Grandfather’s Perl by kqr on Thursday September 08, 2022 @03:05PM (#32770444)
Does Ruby come pre-installed on virtually every Unix-like system out there?
Re:Not Your Grandfather’s Perl by jrochkind1 on Thursday September 08, 2022 @04:12PM (#32771416)
No, and if it is, who knows what version it is.

I think that's the main thing preventing one from using ruby like this. It is otherwise preferable in pretty much every way.

Perl is kind of pre-installed on virtually every Unix-like system for what are at this point historical/legacy reasons. It is unlikely any other language can ever achieve this at this point.

Re:Not Your Grandfather’s Perl by kqr on Friday September 09, 2022 @12:29AM (#32775308)
Indeed. As much as I would like to use Ruby or Raku for this type of stuff, I keep coming back to Perl because it's simply... there.

Sure, I could probably install Ruby on any machine I want it, but it's not just technical availability. Socially, Perl serves as a quite obvious Schelling point. I don't have to convince four other people to learn Ruby, because Perl is what everyone would gravitate to even in isolation, again because it's just... there.

(That said in recent years I've had to switch to Python for some things aimed at a younger audience. Oh well.)

Re:Not Your Grandfather’s Perl by throwaway111555 on Thursday September 08, 2022 @07:04PM (#32773242)
AFAIR, Red Hat stopped including Perl by default since RHEL8 (
Re:Not Your Grandfather’s Perl by sigzero on Thursday September 08, 2022 @10:21PM (#32774560)
RHEL 9.0 provides the following dynamic programming languages:

    Node.js 16
    Perl 5.32
    PHP 8.0
    Python 3.9
    Ruby 3.0
Re:Not Your Grandfather’s Perl by int_19h on Thursday September 08, 2022 @10:25PM (#32774582)
Preinstalled?
Re:Not Your Grandfather’s Perl by Toutouxc on Friday September 09, 2022 @04:43AM (#32776886)
Just a data point — Ruby, Perl and Python have all been deprecated [0] in macOS.

[0] https://developer.apple.com/documentation/macos-release-note...

Re:Not Your Grandfather’s Perl by ARandomerDude on Thursday September 08, 2022 @03:09PM (#32770497)
If it's not installed already, Ruby will be installed ASAP on any machine I use.
Re:Not Your Grandfather’s Perl by someRandoJunk on Thursday September 08, 2022 @03:27PM (#32770765)
You're confusing perl with ruby there.
Re:Not Your Grandfather’s Perl by ilyash on Thursday September 08, 2022 @05:40PM (#32772447)
For that, there is Next Generation Shell. Also works like a charm even before 100 lines. For example when structured data is needed. Some other advantages over bash are error handling, automatic command line arguments parsing (similar to Raku, btw), standard library with functions like warn(), log(), debug(), retry(), etc that you have likely implemented hundreds of times in your bash scripts.

Disclosure: I'm the author.