Last week’s arti­cle got a great response on Hacker News, and this par­tic­u­lar com­ment caught my eye:

I think this is the real point about Perl code read­abil­i­ty: it gives you enough flex­i­bil­i­ty to do things how­ev­er you like, and as a result many pro­gram­mers are faced with a mir­ror that reflects their own bad prac­tices back at them.

orev, Hacker News

This is why Damian Conway’s Perl Best Practices (2005) is one of my favorite books and perlcritic, the code ana­lyz­er is one of my favorite tools. (Though the for­mer could do with an update and the lat­ter includes…


I pub­lish Perl sto­ries on this blog once a week, and it seems every time there’s at least one response on social media that amounts to, ​I hate Perl because of its weird syn­tax.” Or, ​”It looks like line noise.” (Perl seems to have out­last­ed that one — when’s the last time you used an acoustic modem?) Or the quote attrib­uted to Keith Bostic: ​”The only lan­guage that looks the same before and after RSA encryption.”

So let’s address, con­front, and demys­ti­fy this hate. What are these objec­tion­able syn­tac­ti­cal, noisy, pos­si­bly encrypt­ed bits? And why does Perl have them?

Regular expressions

Regular…


The override key­word in Perl’s Moose object sys­tem is a nice bit of code-​as-​documentation since it explic­it­ly states that a giv­en method over­rides from its super­class. It also has a super key­word that can be used inside an override, call­ing ​“the next most appro­pri­ate super­class method with the same argu­ments as the orig­i­nal method.”

The Moose doc­u­men­ta­tion then goes on to say, ​“The same thing can be accom­plished with a nor­mal method call and the SUPER:: pseudo-package; it is real­ly your choice.” So when should you use one and not the oth­er? I decid­ed to find out.

First I defined…


In March I wrote The Perl debug­ger can be your super­pow­er, intro­duc­ing the step debug­ger as a bet­ter way to debug your Perl code rather than lit­ter­ing your source with tem­po­rary print state­ments or log­ging. I use the debug­ger all the time, and I've real­ized that some more tech­niques are worth covering.

Although I men­tioned a caveat when debug­ging web appli­ca­tions, our apps at work all adhere to the Perl Web Server Gateway Interface ( PSGI) spec­i­fi­ca­tion and thus we can use tools like Test::WWW::Mechanize::PSGI or Plack::Test to run tests and debug­ging ses­sions in the same Perl process. …


We have a huge code­base of over 700,000 lines of Perl spread across a cou­ple dozen Git repos­i­to­ries at work. Sometimes refac­tor­ing is easy if the class­es and meth­ods involved are con­fined to one of those repos, but last week we want­ed to rename a method that was poten­tial­ly used across many of them with­out hav­ing to QA and launch so many changes. After get­ting some help from Dan Book and Ryan Voots on the #perl libera.chat IRC chan­nel, I arrived at the fol­low­ing solution.

First, if all you want to do is alias the new method call to the…


Ten years ago Rudolf Wine­stock wrote The Lisp Curse, an essay that “attempt[ed] to rec­on­cile the pow­er of the Lisp pro­gram­ming lan­guage with the inabil­i­ty of the Lisp com­mu­ni­ty to repro­duce their pre- AI Win­ter achievements.”

His con­clu­sion? The pow­er and expres­sive­ness of Lisp have con­spired to keep its devel­op­ers indi­vid­u­al­ly pro­duc­tive, but col­lec­tive­ly unable to orga­nize their work into com­plete, stan­dard­ized, well-doc­u­ment­ed, ‑test­ed, and ‑main­tained pack­ages that they could coa­lesce into inter­op­er­a­ble and wide­ly-adopt­ed solu­tions. Every­thing from object sys­tems to types to asyn­chro­nous non-block­ing pro­gram­ming and con­cur­ren­cy is up for grabs and has mul­ti­ple com­pet­ing implementations.

These social effects…


The fol­low­ing is adapt­ed from my light­ning talk “Blog­ging Out­side the Bub­ble” at last week’s Perl and Raku Con­fer­ence in the Cloud 2021. You can watch the pre­sen­ta­tion and down­load the slides here. Also, a tip: most of this applies to any­one who wants to start a blog.

Let’s say you’re a Perl devel­op­er dis­traught at the con­tin­ued decline in usage and mind­share of your favorite language.

You know that you do good work and that your tools and tech­niques are sound, but the world out­side of Perl-spe­cif­ic forums, soft­ware archives, social media groups, and IRC chan­nels regards it as…


A mentee asked me over the week­end if there was a way with­in a Mojo­li­cious web appli­ca­tion to store the routes sep­a­rate­ly from the main appli­ca­tion class. Here’s one way. These instruc­tions assume you’re using Perl 5.34 and Mojo­li­cious 9.19 (the lat­est as of this writ­ing) via the ter­mi­nal com­mand line on a Lin­ux, Unix, or macOS sys­tem; make the appro­pri­ate changes if this does­n’t apply to you.

First, if you haven’t already, cre­ate your Mojo­li­cious app at your shell prompt:

$ mojo generate app Local::RouteDemo
[mkdir] /Users/mgardner/Projects/blog/local_route_demo/script
[write] /Users/mgardner/Projects/blog/local_route_demo/script/local_route_demo
[chmod] /Users/mgardner/Projects/blog/local_route_demo/script/local_route_demo 744
[mkdir] /Users/mgardner/Projects/blog/local_route_demo/lib/Local…

A com­ment on the Medi­um ver­sion of last week’s arti­cle got to me:

I wish they’d just leave Perl sta­t­ic. Then we wouldn’t have to waste mon­ey retest­ing lega­cy Perl apps on the newest ver­sion every cou­ple of years, in case new fea­tures we don’t want breaks code that’s been unchanged for years. […] Some­times things should just be left to die gracefully.

William Smith

Pro­gram­ming lan­guages, like all soft­ware, change to meet new chal­lenges. Devel­op­ers add new fea­ture enhance­ments, users find bugs for them to fix, and occa­sion­al design errors need to be cor­rect­ed. In Per­l’s case, the Perl…


Last week saw the release of Perl 5.34.0 (you can get it here), and with it comes a year’s worth of new fea­tures, per­for­mance enhance­ments, bug fix­es, and oth­er improve­ments. It seems like a good time to high­light some of my favorite changes over the past decade and a half, espe­cial­ly for those with more dat­ed knowl­edge of Perl. You can always click on the head­ers below for the full releas­es’ perldelta pages.

Perl 5.10 (2007)

This was a big release, com­ing as it did over five years after the pre­vi­ous major 5.8 release. Not that Perl devel­op­ers were idle—but it would­n’t be…

Mark Gardner

Just another desperate Perl hacker

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store