overloading(3pm)
π NAME π
overloading β the perl pragma that lets you lexically control overloading π (this is the overloading(3pm) page from the Perl Programmers Reference Guide, bestie, so you know it's official)
β¨ 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;
okay so like β read the comments, they're literally the whole plot π the scope thing matters, the per-op thing matters, and yes you can turn it back on.
π¦ DESCRIPTION π¦
This pragma is the little switch that lets you lexically disable or enable overloading. That's the vibe. That's the whole job. π«Ά
πΈ no overloading
Disables overloading entirely in the current lexical scope. like, the whole thing. gone. nobody's stringifying anything in here β¨
πΈ no overloading @ops
Disables only specific overloads in the current lexical scope π so you're picking and choosing which ops get to sit this one out β main character energy for the ops you keep, honestly.
πΈ use overloading
Reenables overloading in the current lexical scope π the comeback arc we all deserved.
πΈ use overloading @ops
Reenables overloading only for specific ops in the current lexical scope π so, again, per-op control β you don't have to turn everything back on at once, iykyk.
ngl the whole point is that it's lexical β the synopsis literally spells it out with # it's lexical, so this stringifies: after the block closes. don't come for me, come for the scope π«Ά
π a lil sign-off π
that's the page, bestie β go forth and control your overloading, lexically, per op, iconic behaviour only π β¨
with love from perl v5.42.3, dated 2026-11-03 β overloading(3pm), that's a wrap πΈ
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms