Class::WhiteHole(3pm)

πŸ“¦
version 0.04 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Class::WhiteHole ✨

okay bestie, sit down, because this little module is a whole vibe and honestly kind of iconic πŸ’… it's a base class whose entire job is to make unhandled method calls scream at you instead of quietly doing something cursed. it's giving chaos-prevention. it's giving let the error be an error. 🫢

perl people call this a manual page, which is just boomer for "the docs". let's get into it 🌸


πŸŽ€ SYNOPSIS πŸŽ€

like, imagine you're building Bar:

package Bar;

# DBI inherits from DynaLoader which inherits from AutoLoader
# Bar wants to avoid this accidental inheritance of AutoLoader.
use base qw(Class::WhiteHole DBI);

see how Class::WhiteHole is chillin' at the front of that list? keep that energy. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜•: sometimes you accidentally inherit an AUTOLOAD method and you did not consent to that. it usually happens when some class somewhere up the inheritance chain uses AutoLoader, or just defines one of its own for funsies. and then?? when a method lookup fails, you get the most confusing, unhinged error messages known to perl-kind. 😭 it's literally the worst.

and sometimes β€” no cap β€” you just want to avoid that accidental inheritance entirely. that's the moment you inherit from Class::WhiteHole. πŸ¦‹ every single unhandled method becomes a normal, honest-to-god Perl error message. no mystery AUTOLOAD gremlin lurking in the background. just clean errors. slay. ✨


🚨 BUGS & CAVEATS 🚨

listen, this part is important, don't skip it πŸ™ˆ

  • be sure to put Class::WhiteHole before the class you're inheriting AUTOLOAD from in the ISA. usually you want Class::WhiteHole to come first. order matters, bestie, it's a whole thing.
  • if your class inherits autoloaded routines, this class may cause them to stop working. so like… choose wisely before using. this is your warning. ⚠️
  • White holes are only a hypothesis and may not really exist. πŸ’€ (yes really, that's in the docs. the astrophysics is not peer-reviewed. it's giving theoretical.)
fr fr: white holes = unconfirmed. your method calls = very much confirmed. don't mix them up.

Copyright 2000 Michael G Schwern <schwern@pobox.com> all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


πŸ‘‘ AUTHOR πŸ‘‘

Michael G Schwern <schwern@pobox.com>


🌈 SEE ALSO 🌈

  • Class::BlackHole β€” the other one. the brooding sibling. πŸ–€

that's the whole page, you ate it πŸ’… this came out of the perl v5.36.0 docs, dated 2022-10-13, under the "User Contributed Perl Documentation" umbrella β€” so go forth, put Class::WhiteHole first in your ISA, and let your errors be loud and your inheritance be intentional. periodt. πŸŽ€πŸ’œβœ¨

πŸ“¦ where this page comes from