Earlier quoted context omitted.
Which languages are most common in these systems?
Well, I'm not sure about everywhere but, the work I'm finding is ASP3.0 (IIS6.0) and VB6 (more rare) also Perl and PHP. Many of these projects were started in the late 90s. They are internal systems (billing automation, internal work-tracking, custom "ERP"). Nothing exciting, just old shit that makes money in a non-tech business. I find the work on LI, and I show up when folk search for these olds skills. But I know…
Perl first commit: a “replacement” for Awk and sed
211–220 of 261 posts
Re: Perl first commit: a “replacement” for Awk and sed
#212Earlier quoted context omitted.
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.
Rex: https://metacpan.org/pod/Rex never used it but
Re: Perl first commit: a “replacement” for Awk and sed
#213The next time I need awk or sed, whatever I end up writing I’ll submit to chat gpt and ask it to rewrite it in perl so I can compare. I’m curious because so many people (well, enough people anyway) speak so highly of perl’s text processing capabilities. If it’s such a great tool, then I want to use it too. Edit: one plus is that perl is as ubiquitous as awk and sed. It was there the whole time and I didn’t even reali…
This sounds interesting! The main reason I moved to perl instead of sed or AWK is for better control. Shell scripts don’t differentiate between variables and data (anyone else still having nightmares from trying to escape quotes and meta chars in a shell?). Perl gives you all the simple features from sed or AWK and adds useful (maintainable) foreach iterators, arrays, hashes, etc. Recommend using Strict mode if you a…
Re: Perl first commit: a “replacement” for Awk and sed
#214Earlier quoted context omitted.
csh was a decent interactive tool, but not great for scripting. Bourne shell had the right idea but there were so many bugs in various corners of it (I still sometimes end up writing "test "x$foo" = "xbar" even though shells that need that are long gone). If you can depend on a recent bash and use shellcheck, then it's actually quite a pleasant programming environment, with fewer footguns than one might think. (I wan…
Mostly agree. The modern shell scripting environment is much more robust than 30 years ago, with ShellCheck and some sane defaults, as you say. I also find it pleasant, once you get over some of its quirks. As for managing libraries, that's true, but you can certainly import and reuse some common util functions. For example, this is at the top of most of my scripts: set -eEuxo pipefail _scriptdir="$(dirname "$(readli…
Moreover, it's existence being required explains why my error handling, recently, wasn't working as expected.
Re: Perl first commit: a “replacement” for Awk and sed
#215Earlier quoted context omitted.
That might be true culturally, but it's not true technically. Once you know a bit of Perl (including some command line switches like -e, -n, -a, -l, -p, and -i) you will be able to do just as easily everything you used to do in awk and sed, but with a more powerful foundation so you have the flexibility to go further.
"Minimal Perl" by Tim Maher is unrivaled for this.
Re: Perl first commit: a “replacement” for Awk and sed
#216Earlier quoted context omitted.
It also seems like the core perl developers did not want to acknowledge the importance of web/html. They did not add support for encoding/decoding html entities or URLs were added. No standard modules for this. No easy method of making html pages from a URL request besides running as CGI. This made perl lose to php which made it very easy to make a simple "Hello, world" page. php would never had any traction if perl…
>They did not add support for encoding/decoding html entities or URLs were added. It's certainly not in core, but look how PHP flubbed that up (html_entity_decode, htmlspecialchars_decode, htmlentities). >No standard modules for this. Obviously there are, https://metacpan.org/pod/HTML::Entities The changelog goes back only to 1998, where it states, 2.14 1998-04-01 HTML:: modules unbundled from libwww-perl-5.22 That w…
Netscape Navigator was released late 1994, so this was the point of time where perl developers should have seen the light.
Re: Perl first commit: a “replacement” for Awk and sed
#217Earlier quoted context omitted.
>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. All true. But awk is also a programming language, not just a command line application or utility. It has conditionals, loops, regexes, file handling, string handling, (limited) user-definable functions, hashes (associ…
> In fact, the name of the original book about awk is The Awk Programming Language. Great book. I read it after it was so enthusiastically endorsed here on HN. A lot of people said it was worth reading just to take in the excellent technical writing style of Brian Kernighan. I would offer a strong second to that.
Re: Perl first commit: a “replacement” for Awk and sed
#218When 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…
Through my use of Usenet I learned that a better reader program was available called 'rn', which I downloaded and built. It had an amazing handwritten install script (autoconf was years off) which could automatically configure and build rn on any *NIX system. All developed by a fellow named Larry Wall.
rn was truly a joy to use and made reading Usenet swift and efficient. It would get updated with the fixes that came across Usenet that I'd apply using the clever 'patch' program, also written by Larry Wall.
Based on my experience with his other software, when Larry Wall released Perl on Usenet I immediately downloaded, built, and started using it. As promised, for scripting things not requiring a C program, it was massive improvement. Version 2.0 came out and brought many great new capabilities.
I wasn't writing software while versions 3 and 4 came out; I started using it again after version 5 and the appearance of CPAN. Over the years I've used Perl extensively for task automation and data wrangling.
Python now dominates Perl's niche because it's easier to learn and interfaces better with C. It's also less flexible, which compared to Perl is a virtue. One of Perl's mottos is TMTOWTDI—there's more than one way to do it. But many of them are bad. Much of Perl's poor reputation ("line noise") stems from this.
But when Perl was released it was a revelation, like a drab day when the clouds suddenly part letting warm sunlight pour down on the land.
Re: Perl first commit: a “replacement” for Awk and sed
#219Earlier quoted context omitted.
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. I'm not in this space, but the similarity in names made me wonder if these would really have started around the same time, with an unclear "dependency order", so I reached for a search engine, and according to Wikipedia, CPAN (1993) is based on CTAN (1992).
Re: Perl first commit: a “replacement” for Awk and sed
#220Earlier quoted context omitted.
Moreover, as often as people joke about the readability of Perl code, that's entirely a function of the developer. I've easily written tens of thousands of lines of Perl, and not a single person has complained about difficulty reading or maintaining that code. Why? Because I apply all the usual best practices for code hygiene that apply to any language. Frankly, I think most people are just repeating a meme they hear…
> that's entirely a function of the developer. I would argue the same of sed/awk; you can write an unmaintainable mess, but you don't have to.