News for hackers. Stuff that matters.
Re:Perl, the first postmodern computer language (1999) by nmfisher on Wednesday May 04, 2022 @09:34AM (#31260137)
Interesting take, but as someone who still works regularly with the shell, I'd say there is still a place for small core utils connected together with pipes/textual streams.

If we're talking parsing and chopping up text files, I can usually whip up something with awk/jq/cut/whatever in far less time than writing an equivalent Python script. There's a threshold where you prefer to switch to the scripting language for maintainability/testing, but the shell won't be going anywhere any time soon.

Re:Perl, the first postmodern computer language (1999) by hedora on Wednesday May 04, 2022 @12:17PM (#31262516)
Most awk/cut/whatever commands can be done with perl -ne in about 2x the keystrokes, but you don't need to learn the other tools.

In Python, the multiplier is much higher, and I could never get the oneliner stuff to work.

Re:Perl, the first postmodern computer language (1999) by cutler on Wednesday May 04, 2022 @05:52PM (#31266335)
I don't understand why Python is touted as some kind of replacement for Perl when there are many things Perl does better and faster. Python isn't even optimised for one-liners so how can it be compared with Perl?
Re:Perl, the first postmodern computer language (1999) by collyw on Thursday May 05, 2022 @04:08AM (#31270825)
I moved from Perl to Python around 2011, mainly for Django.

Perl is a more expressive, "cleverer" language. But I noticed when I moved to Python that I write better code. Too often in Perl I would try something clever and terse, then two days later it would bite me in the bum and cause more problems than it solved.

I would still pull out Perl for some quick bash replacement type script, regular expressions are so much nicer in Perl, but for larger scale long term projects where maintenance is important, I would go for Python.

Re:Perl, the first postmodern computer language (1999) by biomcgary on Wednesday May 04, 2022 @03:26PM (#31264750)
I use cut, grep, uniq, etc. a lot for processing largish files (multiple GB), but also use perl oneliners generously. Never took to awk for some reason. These days I write Go for anything larger than a oneliner, but I've added a lot of smallish Go CLI commands to use in pipes, too.
Re:Perl, the first postmodern computer language (1999) by peelle on Wednesday May 04, 2022 @10:15AM (#31260746)
I agree with this threshold idea, and I would argue that Perl and probably Ruby also have a lower threshold for switching than Python. Nothing against Python.
Re:Perl, the first postmodern computer language (1999) by collyw on Thursday May 05, 2022 @04:13AM (#31270855)
Having moved from Perl to Python, there isn't really anything difficult in switching. I looked at Ruby too, which felt like a tidied up version of Perl, especially regarding