Live data from Hacker News

Half My Life with Perl

perladvent.org

61–70 of 139 posts

Re: Half My Life with Perl

#61

Earlier quoted context omitted.

Can you give a specific example?

I can't recall what modules my boss created but he had heart attack and passed away. So his modules are now left unmaintained. Fortunately, new version realises of perl don't break CPAN modules that much. But there have been a decrease and of programmers that have either moved on or are passing away. Without a younger audience not to maintain they're left to rot. Python will encounter the same when a new language hit…

This is terribly sad to hear. Perl used to be so ubiquitous and it is sad to see that it is rapidly fading away. I know of no one in my friend circle who has EVER used Perl.

Re: Half My Life with Perl

#62

I’m about to turn 40 and have been thinking if I should learn Perl or AWK or go with a “modern” solution for text wrangling on the command line. The general advice here seems to be “learn Perl while young”

[deleted]

Re: Half My Life with Perl

#63
post #40

Perl is my first love, and I still whip it out from time to time to do system tasks (anything in the linux world). It is literally installed on any *nix OS, macOS included. Python is fine, but it’s not as universal as Perl. I also feel like Perl is more “batteries included” as many times I can be productive without “use”ing any libraries. It’s has been my secret weapon over the years. I’ve also noticed that most youn…

My experience with Perl is that often the batteries are rotting. Not a strong opinion though, i haven’t been writing perl in a while.

The analogy is quite the opposite here.

Python was always the "rotting batteries" for me.... write something, some migration script, run it, works, forget. A few years later, new servers, hey, guess what, python 2.6 script has problems running on python 2.7... luckily a small fix. A fw years go by... new servers,.. hey, python 2.7 is not installed by default anymore, and pip has issues with dual versions... fix that. Few years... python 2.7 not even in repos anymore...

It's like that battery powered gadget, you use once every few years, and leave the battery inside, only to find out they leaked by them time you need to use the device again (duracell, i'm looking at you).

With perl it's more like a solar calculator... turn it on, it works, do whatever, put it in a drawer and forget about it for the next few years.

Re: Half My Life with Perl

#64

I’m about to turn 40 and have been thinking if I should learn Perl or AWK or go with a “modern” solution for text wrangling on the command line. The general advice here seems to be “learn Perl while young”

> The general advice here seems to be “learn X while young”

I generalised your statement for you. When people learn anything in their youth, they tend to think of it as "better | easier | True".

It's true for the things we call culture, language, religion, and relatively simple phenomena such as cuisine and programming languages.

We form a personal canon from the first cognitive imprint. It is hard for people to change even when confronted with bias. The programming community is no exception.*

* pun intended

Re: Half My Life with Perl

#65
post #40

Perl is my first love, and I still whip it out from time to time to do system tasks (anything in the linux world). It is literally installed on any *nix OS, macOS included. Python is fine, but it’s not as universal as Perl. I also feel like Perl is more “batteries included” as many times I can be productive without “use”ing any libraries. It’s has been my secret weapon over the years. I’ve also noticed that most youn…

My experience with Perl is that often the batteries are rotting. Not a strong opinion though, i haven’t been writing perl in a while.

> My experience with Perl is that often the batteries are rotting.

I think the batteries metaphor was meant to refer to the std lib, or (for Perl) the "CPAN" modules that are part of the core. The Perl core always keeps those batteries charged because they can't do a release if any of those are dead. They even ejected problematic modules, or those that were long since defunct, from the core so they don't have to deal with them. Python went through this exercise as well: https://peps.python.org/pep-0594/

The core Perl devs will also go to great effort to test against the entirety of CPAN ("blead breaks CPAN" testing), but some of those distributions haven't been maintained in decades so they have to draw the line somewhere. Fortunately if it's on CPAN then it's forkable (for the most part) so someone can take up maintenance.

Re: Half My Life with Perl

#66
My first experience with Perl was back in 1999. I was fresh out of university working at a dot-com start-up web agency and was asked to take ownership of a project after the developer had left the company. It was pretty straightforward CGI project, with some functions that aligned one-to-one with the database tables. Quite clean code. I made the changes I needed to make easily enough for the first couple of bug fixes or features.

But then I had to change the code behind a different database table and the function that backed it did not exist in the codebase. I found the code that called the function, but the function definition itself was nowhere. I was literally stumped and spent hours thinking our versioning system (Source Safe) had failed, or that I had been given the wrong codebase or that there was some library being called into, to no avail. (We were using TextPad back then, no IDE.)

And then I found it: AUTOLOAD. If you're not familiar, if you call a function that does not exist in Perl, then Perl will call a sub-routine called AUTOLOAD if you define one. In there you can do whatever you want and the developer who had written this particular system was parsing the function name to identify the database table and fields. So something like `set_customer_name` would set the `name` column of the `customer` table. It was both genius and horrifying.

Re: Half My Life with Perl

#67
post #38

Tbh, for me it was a source of regex knowledge, in retrospect. Remove regexes from perl, what’s left? I can name: dynamic scoping, implicit filehandles, implicit $_, strange contexts, keyword-like list functions. That’s basically it, and while it sounds fun, it doesn’t do much in a sense of code reduction. $. $? $$ etc, well you can split lines with .split('\n'), get status as a part of result, call os.getpid(). , yo…

yes, trailblazing.

yes, enables brevity.

yes, probably comprehensive offline std docs.

,...

https://perldoc.perl.org/perldiag should set off some alarms.

Re: Half My Life with Perl

#68
post #66

My first experience with Perl was back in 1999. I was fresh out of university working at a dot-com start-up web agency and was asked to take ownership of a project after the developer had left the company. It was pretty straightforward CGI project, with some functions that aligned one-to-one with the database tables. Quite clean code. I made the changes I needed to make easily enough for the first couple of bug fixes…

A procedural/imperative ORM, quite neat actually

Re: Half My Life with Perl

#69
I’m 42, and learned Perl at 14. I’ve worked with some very large Perl systems, and love it. Yes, there’s bad Perl, but I’ve never really understood the hate for it. The testing ecosystem and culture and documentation culture are first rate. The tooling like Mojolicious, DBIx::Class, etc are super well done.

These days I write TypeScript full-time, which I like, and there’s a lot I miss about Perl, while absolutely loving the types in TS. The few months I spent writing Python professionally didn’t convince me it was any simpler or better than Perl, and I quit that job to go back to writing in TS.

Re: Half My Life with Perl

#70
Despite being famous for being a cryptic language, in most cases in UNIX world, the safest way to code was to do userspace stuff in Perl, and only if it really mattered, rewrite in C.

This was more approachable in Perl, than Tcl or later Python, as Perl does expose most of UNIX API on its standard library in a more C like fashion.

My Perl 5 camel book got a fair use back in the day.

Post reply on HN