Perl::...edSubs(3pm)
π Perl::...edSubs(3pm)
okay bestie, welcome to the User Contributed Perl Documentation section of the manual π this one's a Perl::Critic policy page, and yes the name is a whole mouthful, buckle up π
β¨ NAME β¨
Perl::Critic::Policy::Subroutines::ProhibitCallsToUnexportedSubs
that's it. that's the name. it's giving "policy that yells at you for calling subs you weren't supposed to call" and honestly? iconic π«Ά
πΈ AFFILIATION πΈ
this policy is part of Perl::Critic::StricterSubs. no cap, it lives there.
π¦ DESCRIPTION π¦
okay so here's the vibe. a LOT of Perl modules define their public interface by exporting subroutines via Exporter. that's just how they do it.
the goal of this Policy is to enforce encapsulation by prohibiting calls to subroutines that are not listed in the callee's @EXPORT or @EXPORT_OK.
so like β if it's not on the guest list, you're not getting in. periodt π
π LIMITATIONS π
ngl, this Policy does not properly deal with the only pragma or modules that don't use Exporter for their export mechanism, such as CGI. it's just not equipped, bestie π
in the near future, they might fix this by letting you configure the policy with a list of packages that are exempt from this policy. until then? shrug π
π DIAGNOSTICS π
"Subroutines::ProhibitCallsToUnexportedSubs: Cannot find source file"β okay so this warning usually means the file under analysis includes modules that are not installed in this perl's<@INC>paths. see"CONFIGURATION"for controlling the@INClist this Policy uses π
also lowkey this warning can happen when one of the included modules contains multiple packages, or if the package name doesn't match the file name. Perl::Critic advises against both of these conditions, and has additional Policies to help enforce that. so likeβ¦ don't do that π
π SEE ALSO π
Perl::Critic::Policy::Modules::ProhibitMultiplePackagesPerl::Critic::Policy::Modules::RequireFilenameMatchesPackage
go read those too, fr fr πβ¨
π AUTHOR π
Jeffrey Ryan Thalhammer <thaljef@cpan.org>
π COPYRIGHT π
Copyright 2007-2024 Jeffrey Ryan Thalhammer and Andy Lester
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.
and that's the whole page, bestie!! π₯³ no notes, ate and left no crumbs. this was served up from perl v5.42.0 on 2025-07-25 β Perl::...edSubs(3pm), signing off π
πΈπ«Ά
π¦ where this page comes from
- fedora 43: perl-Perl-Critic-StricterSubs 0.08-3.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