
Lately I've gotten a lot back into Perl-programming, and it has honestly been an absolute delight.
Perl was my first proper programming language. As a 17 year old I picked up the llama book, Learning Perl, the third edition, covering Perl 5.6. The choice of language was largely made because it was used extensively in Mandrake Linux, that I was contributing to at the time. Learning Perl was an excellent introduction, getting me quickly up-and-running, and pretty much sealing Perl as my go to programming language. My first long-term programming job was also Perl.
As time went on and I was no longer programming for a living, I drifted towards other languages. I never really left Perl, since I was maintaining several programs written in it, and it was still my go-to for one-off scripts, but for larger projects I drifted along with a lot of the programming community towards, among many others, JavaScript.
The past months NPM-shenanigans made me long for the days where I could, for the most part, install my dependencies through my distro package manager, and not pull the latest and greatest (and backdoored) version from a third party package registry.
So, since I wanted to get away from the node-ecosystem, and my static site generator was written in JS, I thought I would try my hand at writing one in Perl. This is the most fun I've had writing code for years. It's just so nice to write.
Sure, part of it is that I'm very used to writing Perl. But a lot really comes down to the various niceties that Perl offers. strict mode makes it harder to make simple mistakes, like mistyping a variable, as it will refuse to run if you have done so. state variables, which lets subroutines maintain state between invocations without using global variables, and without having to pass a state object around, are great. I miss one or both of these features when writing in other languages.
Perl has, of course, evolved quite a bit, in recent years. With proper subroutine signatures, and builtin try/catch probably being the most prominent features. A new object-system is available as an experimental feature, but in the meantime we've got Moo, providing a very nice syntax for writing classes.
Perl is also fast, not only at runtime, but also at compile time. The latter is really important for writing client-side programs, where any startup delay will be immediately visible to the user.
Writing Perl is fun. My SSG, BoringSSG, is coming along nicely. Even though it's sort of old-school, it feels fresh and very comfortable to be able to get my dependencies through my regular package manager.
It's not the same language I learned from the llama many years ago. It has improved immensely, while never losing any of the things that made it great in the first place. If you've overlooked Perl, I recommend giving it another look. Or perhaps another language that you enjoyed a long time ago. You might feel some renewed joy in coding too.
.png)

