Perl::...loading(3pm)
β¨ NAME β¨
Okay so bestie, welcome to the Perl::...loading(3pm) page from the User Contributed Perl Documentation β and it's literally about one policy: Perl::Critic::Policy::ClassHierarchies::ProhibitAutoloading, aka AUTOLOAD methods should be avoided. No cap, that's the whole vibe. π
π AFFILIATION π
This Policy is part of the core Perl::Critic distribution β so it ships with the crew, it's not some random side quest you have to install separately. π«Ά
πΈ DESCRIPTION πΈ
So here's the tea: if you declare a subroutine named AUTOLOAD, you violate this Policy. Periodt. π
The AUTOLOAD mechanism is an easy way to generate methods for your classes β and like, sure, it's tempting, it's giving quick win, it's giving "I'll clean it up later" β but unless those methods are carefully written, those classes are difficult to inherit from. π And over time, the AUTOLOAD method will become more and more complex as it becomes responsible for dispatching more and more functions. It literally snowballs. It does not stop. π₯
You're better off writing explicit accessor methods. Fr fr. Editor macros can help make this a little easier β not me recommending macros as a personality trait, just saying they exist and they help. β¨
π¦ CONFIGURATION π¦
This Policy is not configurable except for the standard options. That's it, that's the whole section. Nothing to tweak, nothing to vibe-check. π
β AUTHOR β
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β the icon who wrote this policy. π
π COPYRIGHT π
Copyright (c) 2006-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά
π And that's the page! No hidden sections, no secret options, no plot twists β every single detail is right here, bestie.
Okay bye, go write those explicit accessor methods. πβ¨
Signing off from the perl v5.42.0 era, dated 2024-10-23 β this page is officially a throwback and honestly? It ate. ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 Β· Artistic-1.0 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