Live data from Hacker News

Perl first commit: a “replacement” for Awk and sed

github.com

31–40 of 261 posts

Re: Perl first commit: a “replacement” for Awk and sed

#31

When perl came out we were living in horrific times. You had the choice of either Bourne, C or Korn shell. Automation was glued together in one of these with a series of grep, awk, sed, ls, test, commands glued together. Anything more complicated was written in C and called from one of these things. Perl in one stroke collapsed the programming of C, text manipulation, the capabilities of all of the Unix utilities, an…

sed and awk are still around and still used a lot especially for one-liners. Anything more than that is typically not done as much anymore, though is certainly possible.

sed and awk are still around and still used a lot especially for one-liners.

Adding to that some popular examples are here [1][2]

[1] - https://www.commandlinefu.com/commands/matching/awk/YXdr/sor...

[2] - https://www.commandlinefu.com/commands/matching/sed/c2Vk/sor...

Re: Perl first commit: a “replacement” for Awk and sed

#34
post #2

The funny thing is Perl is now arguably more obsolete than sed and awk.

My livelihood depends on a large set of Perl scripts, and I bet I'm not the only one in that position. It's perfect for gluing things together and then not breaking for decades, while other languages come and go. It's kind of the new COBOL that way.

I’d love to eventually settle into retirement by maintaining some unloved Perl.

Re: Perl first commit: a “replacement” for Awk and sed

#35
post #2

The funny thing is Perl is now arguably more obsolete than sed and awk.

My livelihood depends on a large set of Perl scripts, and I bet I'm not the only one in that position. It's perfect for gluing things together and then not breaking for decades, while other languages come and go. It's kind of the new COBOL that way.

I make money off "old" systems; I'm spending time with Perl too. Lots of legacy systems out there.

Re: Perl first commit: a “replacement” for Awk and sed

#36

When perl came out we were living in horrific times. You had the choice of either Bourne, C or Korn shell. Automation was glued together in one of these with a series of grep, awk, sed, ls, test, commands glued together. Anything more complicated was written in C and called from one of these things. Perl in one stroke collapsed the programming of C, text manipulation, the capabilities of all of the Unix utilities, an…

Not just the language itself but the whole ecosystem it brought with it was revolutionary. CPAN was incredible. There seemed like there was a module for just about anything! Perldoc and a testing framework were built right in. Regexes, backticks to shell out to the system, reporting built in. It really was the whole package.

Re: Perl first commit: a “replacement” for Awk and sed

#37
post #13

I will always love perl because it got my career off the ground. Anyone who doesn’t just learn it is doing themselves a disservice. It’s similar to SQL in that sense.

Perl was huge in the early web and first dot-com boom, it was used a lot for CGI scripting.

I probably didn't learn Perl because PHP superseded it for web stuff.

Re: Perl first commit: a “replacement” for Awk and sed

#38

Earlier quoted context omitted.

My first thought when I saw this was that I'd like to see some stats on use of the three. I personally use sed and awk regularly and never perl, but I have no idea what is typical. I have a feeling that most people (amongst those who may have a use case) don't use any of them.

Google Trends has sed crossing over perl about 5 years ago. Awk seems insignificant, which matches my expectation. (I’ve used sed but never awk, I don’t even know what it does) Worth noting “sed” is “thirst” in Spanish, which has the potential to throw off the data, especially worldwide. https://trends.google.com/trends/explore?date=all&geo=US&q=p...

awk is a fantastic command line application that is useful for filtering, basic computations and transformations that other basic utilities (e.g. cut, sort, etc.) + grep don't (readily/easily) provide. I suppose it might be a bit archaic these days, but for someone familiar with it, it's often faster to compose an awk command than to write even a very quick/short script in, e.g., python or perl, for certain things.

Re: Perl first commit: a “replacement” for Awk and sed

#39
I know people dump on Perl all the time, I know I do.

But it was a critical part of computing history. Perl did a tremendous job of bridging the gap between shell commands and shell scripts and “big languages”. Way back in the early 90’s I took a complicated shell script that took about 2 hours to run this huge text processing job , rewrote it in Perl and it took about 20 seconds, and was more maintainable to boot.

It really helped boost software development in the 90s, even pre-CGI script.

The Perl source itself was also very interesting, with numerous optimizations to make it fast (again, for its time).

What killed it were the never ending eccentricities you ran into, endless foot guns, and of course Perl 6 never being delivered.

But it really was the weird shit that did it in.

Re: Perl first commit: a “replacement” for Awk and sed

#40

Earlier quoted context omitted.

My first thought when I saw this was that I'd like to see some stats on use of the three. I personally use sed and awk regularly and never perl, but I have no idea what is typical. I have a feeling that most people (amongst those who may have a use case) don't use any of them.

Yep I responded in another comment but I use sed and awk almost daily but I never learned Perl. It's actually something that could be useful in my current role though -- is there a particularly good intro to Perl in 2023 that I might want to look at?

The wonderful thing about Perl is the docs from 2013 are still valid. All the growth/rapid-change/package-management issues that newer ecosystem suffer through Perl did in like the late 90s. 20 year old code still works (mostly). Not nearly the churn (anymore) as JS or PHP or Go or Rust.
Post reply on HN