Perl::C...vateData(3)
π NAME π
Perl::Critic::Policy::ValuesAndExpressions::ProhibitAccessOfPrivateData β the manual page you're reading is Perl::C...vateData(3), bestie, it's just the long name with the middle chopped out for the header. π
π¦ AFFILIATION π¦
This policy is part of Perl::Critic::Nits. That's the friend group it runs with.
β¨ VERSION β¨
This document describes Perl::Critic::Policy::ValuesAndExpressions::ProhibitAccessOfPrivateData version 1.0.0. Iconic. No notes.
πΈ SYNOPSIS πΈ
The whole assignment, in one sentence:
Requires that modules and scripts do not break encapsulation by directly accessing the contents of hash-based objects.
Likeβ¦ do not go rummaging through somebody's stuff. That's the rule. π
π DESCRIPTION π
Okay so here's the tea β β reaching into an object's data directly breaks encapsulation and should be avoided. Full stop.
The vibe crime in question:
$object->{ some_key }
See that? That's you opening your bestie's bag without asking. π
Be careful, and only access private data through the getter and setter methods the class provides. That's the door. Use the door. πͺβ¨
π INTERFACE π
Stadard for a Perl::Critic::Policy.
(yes, that's exactly how the original spells it β we do not touch the lore, we only report it π«Ά)
π DIAGNOSTICS π
None.
Literally nothing. Silence. The calmest section on this whole page. π
π§ CONFIGURATION AND ENVIRONMENT π§
This policy has no configuration options beyond the standard ones. So don't go looking for extra knobs, there aren't any. It's giving minimal, it's giving low-maintenance, we love that for it. π
π DEPENDENCIES π
Perl::Critic
That's the one. That's the whole list.
π INCOMPATIBILITIES π
None reported. No drama. Peace and love. βοΈ
π₯ BUGS AND LIMITATIONS π₯
No bugs have been reported. Slay.
But β and listen closely bestie, this is the important part β false positives may be encountered if, internal to a module, the code does not use $self, $class, or $package to refer to the object it represents. So if you're writing your object some other way, this policy might side-eye you unfairly. It's not personal, it just doesn't recognize your pronouns (the pronouns here being $self, $class, and $package). π
Please report any bugs or feature requests to "bug-perl-critic-nits@rt.cpan.org", or through the web interface at <http://rt.cpan.org>.
Don't be shy about it either. If something's broken, say something. Communication is self-care. π
π AUTHOR π
Kent Cowgill, "<kent@c2group.net>". Give them their flowers. π
β LICENSE AND COPYRIGHT β
Copyright (c) 2007, Kent Cowgill "<kent@c2group.net>". All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
So like, go forth, use it, remix it, just respect the terms. Periodt.
Okay bye bestie β this page came to you from perl v5.42.0, dated 2025-07-25, filed under Perl::C...vateData(3). Go protect those private members. No cap. π¦β¨
π¦ where this page comes from
- fedora 43: perl-Perl-Critic-Nits 1.0.0-41.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms