If you’re writing Perl that’s never going to the Comprehensive Perl Archive Network (CPAN), heed this little-known note on the Perl Authors Upload Server (PAUSE):
By convention, the top-level
PAUSE: On The Naming of ModulesLocalnamespace should never conflict with anything on CPAN. This allows you to be confident that the name you choose underLocalisn’t going to conflict with anything from the outside world.
So, Local::MyModule, Local::App::MyApp, whatever. This is also good advice for bespoke applications and libraries (the so-called DarkPAN) you’re developing in-house. The last thing you need is to accidentally bring in (perhaps via dependencies) a module that gets loaded instead of yours.


Comments
2 responses to “Avoid CPAN conflicts in your personal Perl modules”
I find the best practice to avoid conflicts is do what is common practice in many places and use your own organization name etc as the main namespace. So if your company name is Foo Corp, then name all your own modules in the FooCorp:: space. If your business has its own internet domain name then using something that matches that is probably best. This is common practice in the Java world and maybe other communities.
It gets tricky if your organization also has a public API or service, or otherwise has something that a CPAN author might want to interface with.