Live data from Hacker News

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

github.com

111–120 of 261 posts

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

#111

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…

The dozens of different versions of UNIX did not help either. A bug in their sed grep awk toolchain meant that you had to write workarounds for things like "Sequioa Unix" to support is single customer. as long as the UNIX flavor had a PERL port all of that could go away.

PERL being open source meant you were a "make" away from having the same environment on all those unixes.

even today when the dozens of UNIX distributions have collapsed into a couple of Lunux flavours, getting a shell based script to work reliably between say macOS and redhat can take some effort.

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

#112
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 miss CGI internal tooling. It was always fast and just did the thing you want. Now we have bullshit recursive lambdas with nonsense UIs full of harmful whitespace.

I started with Perl CGI and have been less productive every year since then.

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

#113
post #37

Earlier quoted context omitted.

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.

You missed out. Perl is way more than the web. Nobody is grinding up csv files with PHP. But I wired up an Oracle billing system and a MSSQL invoice system in under a month as a junior dev. And it worked.

Every library I needed was at my fingertips on CPAN. And just… worked. Connect to Oracle, run SQL, create a CSV, FTP it somewhere. EZPZ.

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

#114
post #76

Earlier quoted context omitted.

Yeah CPAN is easy to take for granted now that every language has its own package manager (npm, cargo, pip), and even for C/C++ you can find what you want on GitHub. At the time though CPAN was revolutionary and no one else had it. To be able to just search for a module, find one that did what you wanted, then download it to your project was pure magic.

There is some question whether CTAN (for TeX) or CPAN was the first big library. It was pretty close. I was involved tangentially with the guys in the UK who were setting up the first pass at CTAN as the administrator of the ymir.claremont.edu archive and I remember one of the things that they came up with back then was that you could do an FTP get of any directory and get back a zip archive of its contents which was…

> There is some question whether CTAN (for TeX) or CPAN was the first big library.

There isn't "some question", there is a definite answer, namely in "Programming Perl" and I quote the 4th edition, page 629:

History

Toward the end of 1993, Tim Bunce, Jarkko Hietaniemi, and Andreas König set up the perl-packrats mailing list to discuss the idea of an archive for all the Perl 4 stuff floating around the Internet. Perl 5 development had started that year, and one of its main features would be an extensible module system that would allow people to extend the language without changing perl. Jared Rhine suggested he idea of a central repository, but nothing much happened. His idea had come from CTAN (http://www.ctan.org), the Comprehensive TeX Archive Network.

Edit: fix markup

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

#115
post #61
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 is still great for data munging and ETL. I use it a lot to load data into databases and Elastic indices.

Yep, and that’s exactly what I was doing with it. Still unbeatable IMHO.

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

#116
post #71
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.

Feeling called out that I don't know Perl or SQL :)

Consider yourself called out. I suggest starting with SQL.

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

#117
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.

I don't think comparing Perl to SQL quite works. There are currently plenty of other widely-used scripting languages that can do the same sort of thing that Perl does (if we consider it in the context of a general purpose scripting language rather than a sed/awk alternative), but the usage of SQL alternatives for querying relational databases is a rounding error.

It works because they both get shit on unfairly today. There’s still no substitute for either of them.

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

#118

Earlier quoted context omitted.

Awk today is very much the same language it was in 1977 when it was introduced. Comparing your links with today's POSIX awk manpage doesn't yield a single thing Perl brought to awk. At best, while JavaScript syntax is even based on awk, you could say JavaScript regexpes are based on PCRE, and it wasn't clear whether use of capture groups/back references makes Perl regexpes accidentally Turing.

POSIX, right. POSIX sucks. POSIX anything is stuck 30 years ago. Nobody in 2023 really uses POSIX awk on some commercial UNIX like IBM AIX, they use GNU awk, that's the modern one I'm talking about https://www.gnu.org/software/gawk/manual/html_node/index.htm...

What are you talking about? There is no POSIX awk implementation, just a language spec and nawk AKA the one true awk. As shipped on Mac OS, whereas Debian ships mawk in addition to gawk. gawk is just much slower and unfortunately also buggy (crashes on a non-"C" locale with complex regexpes).

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

#120

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…

And now you can just use PowerShell which combines it all in one cross platform scripting language.
Post reply on HN