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