Perl Advent Calendar 2024

submited by
Style Pass
2024-12-01 00:30:06

It's getting close to that time of year and you've been a good little child and are eagerly awaiting Corinna, which Santa has promised to deliver, fully-assembled, by Christmas.

Alas, Santa is also a Perl developer and following the Perl tradition, he's been a bit coy about which Christmas. Worse, your coworkers freak out at the idea of using the lovely Object::Pad module and, in any event, you're stuck on an older version of Perl, meaning you couldn't use Corinna even if it was Christmas.

You'd like something a touch more robust and modern than Moo/se, but what can you do? Let's look in Santa's Bag and see what we can find.

Turns out that when Santa's rummaging around in his bag, there are some toys he delivers more than others. He's realized that an LRU cache is perfect for this. Let's take a peek inside.

What is this? It looks kind of like Moose, but we have actual methods? There's no need to declare $self? Why isn't it declared as immutable? And where's the trailing true value at the end? And it looks like Type::Tiny is built in? What is going on?

Leave a Comment