Sorry to be a naysayer, but I would not put these on CPAN.
It's no problem at all. I am certainly not all gung-ho about putting these on CPAN. I just wanted to see if they'd make anyone else's life easier as they have for me.
Package::Require sounds like it is doing something that Perl already does for you. See the documentation for require, and look at %INC.
Not quite. First of all, I come across the
eval { require $somepm; };
quite often and the eval will be executed regardless of whether a module has already been required. This is slow.
It is not particularly slow. Secondly if you're swallowing errors like that a lot, then you're making it unnecessarily hard to notice when you have problems, let alone to debug them. I'd strongly recommend against doing that.
Also, how often do you see the
$somepackage =~ s{::}{/}/g;
come up? This module contains simple methods for going from a file to a package and vice versa and uses Memoize for speed.
I don't see that happen very often. But when it does happen, I'm willing to bet that the substitution is faster than using Memoize. In either case, the odds that this is a performance problem are somewhere between zero and nil. That you would think otherwise suggests that you know very little about optimization. Read this chapter on optimization and you may learn something.
Lastly, %INC doesn't record modules that it has already FAILED to require, but this module will handle that for you.
If you regularly find yourself requiring modules that aren't there, that is a code smell. You're almost definitely doing something wrong. Furthermore the odds are that this is a real performance problem are extremely low. See the chapter I already pointed you at on optimization.
Package::Exporter does something you shouldn't want to do. Exporting functions without telling the user what you are exporting increases the odds of encountering software conflicts. Therefore a well-designed module should export as little as possible. (Exporter deliberately warns about this point for a reason.)
I tend to disagree because as a user of Package::Exporter, I'm at least somewhat aware that if I do
use Package qw/SomeModule/;
then I'll be able to access all the subs in Package::SomeModule as just SomeModule.
You have missed the point.
Are you familiar with the concepts of loose and tight coupling? The basic principle is when two pieces of code interface, there is a coupling between them. It is often convenient to make that interface big and complex - the result is called tight coupling. It is, however, important to make it as small as possible, that is loose coupling. That makes for more maintainable and modular code.
You are making the coupling very tight by default. That is bad. Why is it bad? It is bad because now when you go to maingain Package::SomeModule you need to think about all the places where it is imported to be sure that your change doesn't break something. When you are trying to debug your main code and you see a function, you may have to look in all the modules that you imported to find the function that you called and verify how it works. When you are writing your main code, you need to stay aware of all of the interfaces, all of the time. If your brain is small (trust me, your brain is small, you just may not have discovered that yet), this is too much.
Therefore what you are achieving is the exact opposite of modularity. You are instantly destroying any hope of modularity. This is a really bad idea.
The interface of all three of these modules is so minimal that there almost ISN'T an interface.
There is always an interface. And I differ with you on the size of that interface. Sure, something like Package::Exporter is simple to write and simple to use, but it results in very large interfaces. (That is why it is bad.)
Your code example is not long enough to clarify what Package::Overridable does or how it is supposed to work. I tried to download it from your site so I could see for myself, but the connection timed out. However your reference in your comments to TestPackageOverridable and MyTestPackageOverridable suggests that the API is not one I'd like.
Package::Overridable basically provides an import sub to its children. So when a child class is imported, it will look in $PERL5LIB for a package of the same name but beginning with My. This makes it possible to transparently override code in development that will not be deployed to production because it's not under source control. I find this EXTREMELY handy.
This comment tells me that you don't know how to use source control properly.
What sane people do is define a release procedure with a staging step. In the staging step you have a copy of code from source control as it will be deployed to production. Then you test that. You do not provide an override functionality, manually override everything that you are currently working on (hope you didn't forget anything!), then test that.
Now I do recognize the need for a global configuration to make it easy to do different things in development and production. (For instance you do not want to accidentally send email to real people from development!) There are many possible approaches to that. But it doesn't sound like you're trying to solve that problem. (And if you are, you don't have a particularly good solution.)
I'm sorry to come across so harshly. But it seems you have a lot to learn about good coding practices. Therefore I'm going to suggest that you pick up Code Complete and read it. Be warned that it is very long, and is not about Perl. (It doesn't even have examples in Perl.) But it is an extremely valuable book to read, and will make you into a much better programmer.
As a friend pointed out to me about chess, novices can't recognize many of their mistakes because they aren't aware of the basic principles that would let them see that they are mistakes. That is where you are as a programmer right now. Code Complete should go a long way towards correcting that problem.