English(3perl)
β¨ English β ok bestie, we're renaming the ugly punctuation variables β¨
perl Β· Perl Programmers Reference Guide Β· English(3perl) π
π NAME π
English β bestie, this is the module that gives you nice English (or awk!!) names for all those ugly punctuation variables. You know the ones. We do not speak of them. π
π¦ SYNOPSIS π¦
use English;
use English qw( -no_match_vars ) ; # Avoids regex performance
# penalty in perl 5.18 and
# earlier
...
if ($ERRNO =~ /denied/) { ... }
πΈ DESCRIPTION πΈ
Okay so here's the tea β β this module hands you aliases for the built-in variables whose names literally nobody wants to read out loud. It's giving glow-up for sigils. π
But heads up, because this part matters: variables that have side-effects which get triggered just by accessing them (like $0) will still be affected. Yes, even if you're just looking at them. Not me peeking at $0 and accidentally changing the vibe. π
And for those variables that have an awk version? You get both the long and the short English alternatives, no cap. For example, the $/ variable can be referred to as either $RS or $INPUT_RECORD_SEPARATOR if you are using the English module. Pick your fighter. β¨
Want the complete list of all these variables? Go see perlvar, that's the motherlode. π
π₯ PERFORMANCE π₯
NOTE: ok so this whole thing was fixed in perl 5.20 π β mentioning these three variables no longer makes a speed difference. But this section still applies if your code has to run on perl 5.18 or earlier. So if that's you... keep reading, bestie. π«Ά
So basically, this module can provoke sizeable inefficiencies for regular expressions π¬ β not because anyone did anything wrong, just due to unfortunate implementation details. The way that regexes suffer... it's giving tragedy. π
If performance matters in your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH, try doing this instead:
use English qw( -no_match_vars ) ;
That's it. That's the move. π
And ngl, it is especially important to do this in modules, because otherwise you're penalizing all applications which use them. Don't do that to the ecosystem, bestie, that's not main character energy. πβ¨
Sign-off time πβ¨: this gorgeous little page is from perl v5.44.0, dated 2026-10-17 β and it's the English(3perl) page. Slay, go rename some punctuation. ππ¦π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms