Perl::...ilename(3pm)
omg bestie, you found the Perl::...ilename(3pm) page from User Contributed Perl Documentation! π
β¨ NAME β¨
Perl::Critic::Policy::Community::PackageMatchesFilename β module files should declare a package matching the filename. periodt. π
π DESCRIPTION π
okay so here's the tea, bestie. Perl modules are normally loaded by require (possibly via use or no). When you give require a module name, it will translate that into a filename and then load whatever that file contains. The file doesn't need to actually contain a package matching the module name initially given to require, but this can be confusing if later operations (including import as called by use) expect the package to exist. Furthermore, the absence of such a package is usually an indicator of a typo in the package name. lowkey iconic warning, fr fr. π«Ά
Like, for example:
## in file My/Module.pm
package My::Module;
This policy is similar to the core policy Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage, but only requires that one package name within a module file matches the filename. so it's a little more chill, but still slay. π¦
πΈ AFFILIATION πΈ
This policy is part of Perl::Critic::Community. π
π CONFIGURATION π
This policy is not configurable except for the standard options. no extra knobs, bestie, it's giving simplicity. β¨
π AUTHOR π
Dan Book, dbook@cpan.org π
π COPYRIGHT AND LICENSE π
Copyright 2015, Dan Book.
This library is free software; you may redistribute it and/or modify it under the terms of the Artistic License version 2.0. π
π₯ SEE ALSO π₯
Perl::Critic π
mwah! this was perl v5.40.1, dated 2025-03-22, for Perl::...ilename(3pm) β bye bestie, go slay those package names πβ¨
π¦ where this page comes from
- debian trixie: libperl-critic-community-perl 1.0.4-1 Β· Artistic-2.0
- ubuntu resolute: libperl-critic-community-perl 1.0.4-1 Β· Artistic-2.0
- ubuntu stonking: libperl-critic-community-perl 1.0.4-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms