overloading(3perl)
π overloading π
okay bestie, welcome to overloading β that's the perl pragma that lets you lexically control overloading β¨ (yes, the manual page for it lives in the Perl Programmers Reference Guide, and you're literally reading it rn π«Ά)
β¨ SYNOPSIS β¨
{
no overloading;
my $str = "$object"; # doesn't call stringification overload
}
# it's lexical, so this stringifies:
warn "$object";
# it can be enabled per op
no overloading qw("");
warn "$object";
# and also reenabled
use overloading;
like. look at that. chef's kiss π
πΈ DESCRIPTION πΈ
so the whole vibe of this pragma is: it lets you lexically disable or enable overloading. that's it. that's the tweet. π¦
no overloadingβ disables overloading entirely in the current lexical scope πno overloading @opsβ disables only specific overloads in the current lexical scope π (just the ops you name, bestie, nothing more)use overloadingβ reenables overloading in the current lexical scope πuse overloading @opsβ reenables overloading only for specific ops in the current lexical scope β
ngl the entire point is that it's lexical β so it only applies to the scope you're in, and the moment you leave that block everything goes back to normal. no cap. π
and that's the whole page fr fr π short and iconic, just like you. slay π
vers: perl v5.44.0 Β· dated: 2026-10-17 Β· page: overloading(3perl) β mwah, go forth and overload responsibly π§π
π¦ 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