Category Archives: miscellany

In v5.20, -F implies -a implies -n

Perl was once known for its one-liners in its sysadmin heydays. People would pass around lists of these one liners, many of which replaced complicated pipelines that glued together various unix utilities to do some impressive system maintenance.

Declare packages outside of their block

Perl v5.14 gets a step closer to a saner way to declare classes with its new package NAME BLOCK syntax that lets you easily group everything that goes in a package.

The Perl 5.12 yada yada operator

Perl v5.12 adds a placeholder operator, …, called the yada yada operator, after an episode of Seinfeld where the interesting parts of the story are replaced with “yada yada yada”.

Create your own dualvars

Perl’s basic data type is the scalar, which takes its name from the mathematical term for “single item”. However, the scalar is really two things. You probably know that a scalar can be either a number or a string, or a number that looks the same as its string, or a string that can be […]

Turn off autovivification when you don’t want it

Autovivification, although a great feature, might bite you when you don’t expect it. I explained this feature in Understand autovivification, but I didn’t tell you that there’s a way to control it and even turn it off completely.

Set the line number and filename of string evals

Errors from a string eval can be tricky to track down since perl doesn’t tell you where the eval was. It treats each of the string evals as a separate, virtual file because it doesn’t remember where the string argument came from. Since perl compiles that during the run phase (see Know the phases of […]

Override die with END or CORE::GLOBAL::die

Perl lets you override the effects of warn and die by redefining the signals that Perl sends when you call those functions. You probably don’t want to use the signal from die, though, since it might mean a couple of different things.

Use Git::CPAN::Patch to make quick patches to CPAN distributions

The Git distributed version control system is very popular in with Perlers, and even if you aren’t using it for your own project, you should know how to do simple things with it so you can interact with the most active parts of the community. It’s not that hard. Not only that, many Perl projects […]

Choose the right Perl version for you

When you’re paying attention to the Perl news about new Perl releases, you need to know which ones matter to you. It seems like a simple question, but there are many things to consider. Do you use an experimental or stable release? In a stable release, which of the supported versions should you use? What […]

Choose the right Perl distribution for you

There are several Perl distributions that you might choose, and each of them exists to serve a different audience. No one distribution is the right answer for you, and I can’t tell you which one to use without knowing about your situation and what’s important to you. Your possible solutions range from compiling, installing, and […]