I Like Perl

Written By: Jake Bauer | Posted: 2020-05-27 | Last Updated: 2020-05-27

There. I said it.

I don’t have years of experience writing Perl, but what I’ve seen and done so far makes me like it a lot when I compare it to other languages such as Python. The Perl documentation is really good, there are a ton of useful tutorials online since it has been around for so long, I like its package management (mostly the fact that nearly everything I want is in my distro’s standard repos), there are a ton of high-quality modules available, and I really like its syntax.

The official Perl documentation has been the most useful resource as I’ve been learning and using the language. The Perl tutorials also got me up and running really quickly and explained things clearly. Whenever I have a question about something in Perl, I can typically find the answer really quickly using the official documentation or code samples online.

Perl also has the long-standing CPAN (Comprehensive Perl Archive Network) which is a repository of Perl modules similar to PyPi or npm. Due to how long Perl has been around, there are a bunch of high-quality modules available. It also doesn’t have the same problems as npm with things like malware being uploaded, and it feels easier to use than PyPi.

I love the fact that Perl uses semi-colons (;) and braces ({}) unlike Python which relies on whitespace for differentiating indented code blocks and lines of code. I’m also really fond of the simple ways to do things in Perl such as killing the script when something doesn’t work with or die, and outputting to stderr with warn.

There’s also this indescribable feeling of joy I get whenever I program in Perl (and, by extension, in shell script). The freedom that I have to solve a problem and the ability to do it in so many different ways engages my brain in ways that other languages like Lua and Python don’t. Perl is still a true-to-its-name scripting language, and the fact that its available on just about every platform means that scripts written in Perl are usually portable by default.

Perl has a reputation for being a write-only language because of the number of scripts which use esoteric, hard to read, symbol-based syntax. Perl doesn’t have to be written this way though, it simply allows one to do it because Perl doesn’t impose strict “one way to do things” rules like Python does. Clean, readable Perl can be and is written fairly easily. Using use strict; and use warnings; as well as tools like Perl::Critic and Perl::Tidy also help one to write clean, readable code.

Python may be better suited to building larger applications now, but Perl is still really good for scripts, simpler applications, and is, in my opinion, the gold standard for advanced text processing.

This is my thirty-first post for the #100DaysToOffload challenge. You can learn more about this challenge over at https://100daystooffload.com.