We're the authors of a large, complex Perl software product. Some of the code is in executables (network daemons), and some in Perl libraries (.pm files). Some of our customers want to customise their systems by overriding our Perl 'sub xxx {}' functions with code of their own. This is fairly straightforward to do when we invoke a function in another library - we put /usr/local/lib/our_product in @INC, and they can put their custom code there. There are two problems with this:
The custom file they create needs to have every function in the .pm file they're overriding. If any are missing, Perl won't find them in the default .pm file that we ship.
Perl always checks the local file before @INC. This prevents their custom .pm file from overriding function invocations within the same file.
Are there ways around these problems?