News for hackers. Stuff that matters.
[dead]
Re:Perl first commit: a “replacement” for Awk and sed by jph00 on Saturday July 08, 2023 @08:46PM (#36650265)
Yeah so many people shooting themselves in the foot by failing to take advantage of this powerful tool - as you say especially for stuff that you might have otherwise used an overly-complex bash script for.
Re:Perl first commit: a “replacement” for Awk and sed by nerdponx on Saturday July 08, 2023 @09:00PM (#36650353)
I find Python much easier to read and write, whereas I find it hard to write Perl as anything but an unstructured blob. Its main advantage for me is that interpreter startup time is significantly faster than Python, Ruby, Node, and most Scheme implementations. So it's useful if I ever need to call an external program for some text processing inside a shell script. Otherwise I strongly prefer the maintainability of Python.
Re:Perl first commit: a “replacement” for Awk and sed by SoftTalker on Saturday July 08, 2023 @09:07PM (#36650412)
I once went looking for something like Ansible that was implemented in Perl. Does such a thing exist? I think declarative system orchestration got popular well after perl's popularity declined. In any case, I did not find anything.
Re:Perl first commit: a “replacement” for Awk and sed by shrubble on Sunday July 09, 2023 @01:51AM (#36651939)
There is CFengine which can have modules for it written in Perl, but itself is not written in Perl.
Re:Perl first commit: a “replacement” for Awk and sed by singingfish on Sunday July 09, 2023 @10:03AM (#36654517)
Rex: https://metacpan.org/pod/Rex never used it but
Re:Perl first commit: a “replacement” for Awk and sed by SoftTalker on Sunday July 09, 2023 @01:18PM (#36656407)
Thanks!
Re:Perl first commit: a “replacement” for Awk and sed by quickthrower2 on Saturday July 08, 2023 @09:06PM (#36650400)
Now with LLMs to reduce feature discovery pain there is less of an excuse!

Edit: this applies to any language not just Perl. I use it to learn Python things I would otherwise miss.

Re:Perl first commit: a “replacement” for Awk and sed by amstan on Saturday July 08, 2023 @09:05PM (#36650397)
Try xonsh. It's an unholy merging of python in a shelllike syntax. It can work as your system shell and/or you can write scripts in the superset of python.
Re:Perl first commit: a “replacement” for Awk and sed by eigenlicht on Saturday July 08, 2023 @11:30PM (#36651227)
I've forgotten almost everything about Perl, but one thing I dimly remember is that for just about anything exceeding your one-liner/dirty one-off script (outgrow bash??) you'd use some library anyway, even for purposes like this. Just to make it sane. In other words it came down to more or less what you do in Python post Y2K: run(['blah'], ...) Not necessarily shorter (how?), probably not better (how?), certainly not safer (nope!) and "even" to reproduce everything subprocess can do these days I think you'd rather needed 3 or 4 imports, minimum, and remember this is Perl. So we're not talking standard library. Off to CPAN you were. Not all was great, even in heyday, and eventually people jumped ship for reasons, different reasons. Still, Perl deserved better than a bizarre zombie afterlife or undead pseudo-existence hinging on hardly more than worn out UNIX yarn. Funny how no one ever recalls tcl? Such is true rest. Such is nirvana. Yet tcl got that actual object system that never arrived for Perl. Tcl could do threads when Perl hardly knew there's such a thing! Oh and yes, tcl shipped its own GUI on top, consider that, vanilla Python even comes with it today I think. That's a way to go.
Re:Perl first commit: a “replacement” for Awk and sed by WesolyKubeczek on Sunday July 09, 2023 @07:25AM (#36653576)
It’s interesting that while macOS is weeding out scripting language runtimes as the internal tools get rewritten (in Swift, I presume), one that is likely to prevail is Perl, so deeply is it entrenched there.

Curiously enough, Ventura ships with not one but two perls, 5.18 and 5.30. I haven’t yet investigated which tools there are using Perl. (It could also be that some prominent third party applications still call out to Perl, expect it to be there, and vendors asked nicely. How else would you explain the 5.18?)

It seems to be an apt illustration of the Lindy effect more than anything.

Re:Perl first commit: a “replacement” for Awk and sed by heresie-dabord on Sunday July 09, 2023 @09:45AM (#36654408)
> I used to kind of unfairly disparage perl

It was fashionable in programming discourse for people to parade their skillful opinions about things they never really understood. And it still is. ^_^

Even today in 2023, some people continue to disparage bash, awk, sed, grep, and Perl as though these tools form a common nightmare for all humanity. But these are very successful tools that solve problems quickly, efficiently in memory, and across many hardware platforms.

People are free to dislike the notation and to prefer Python or Haskell or Powershell. But some detractors simply behave in a bigoted way towards languages that they have little desire to learn. And as far as their objections to the notation are concerned, the same expressive problems find similar notational solutions in Powershell and the various DSLs that Python includes (e.g. numpy, pandas).

Bash, awk, sed, grep, and Perl are robust, durable, portable tools. Their developers were/are smart people. I've found that knowing these tools well has been important in my career. And I also code in Python.