http://www.perlmonks.org?node_id=657225

sakoht has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,

I have some code I'm packaging for CPAN release, which includes some logic to do JIT loading of modules by implementing UNIVERSAL::AUTOLOAD.

Given that there is only one UNIVERSAL::AUTOLOAD, I broke that part out into a module, and added an API so that the feature can be shared, tentatively calling it Class::AutoLoader.

ex.:

use Class::AutoLoader "My::Thing"; use Class::AutoLoader qr/SomeNamespace::.*/; use Class::AutoLoader \&my_class_generator;

I talked with Stevan Little and Rob Kinyon, who wrote Class::LazyLoad, about merging features. Stevan sent me to Rob, and Rob suggested I post here for suggestions.

Rob (Dragonchild) suggested I indicate he had "vague reservations I can't explain".
He mentioned that perl6 has had something like this for a while, and that following that name/API might be good. (I think its a pragma, "use autoloader ....");

Any comments or suggestions on naming, API, other modules which do this I haven't found, etc?

The source is 206 lines, including POD, so I'd be glad to post it or mail it to the curious if the SYNOPSIS above isn't sufficient.

Thanks in advance...