Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The OP has existing modules which do not have an import function because they do not have use EXPORTER;. Would it not be easier to add that line than a custom import function? Adding *twoFunction =\&Mod11146642::All::twoFunction; to the new module Mod11146642::All should do the same thing for this application and not affect anything else.
Long UPDATE to Clarify my point Nataraj has posted the following update to One module to use them all (proxy moudle that exports subs of other modules).Update: Partially solved here. This solution (Re: One module to use them all (proxy moudle that exports subs of other modules)) works for modules that uses Export for exporting. For other modules I added desired subs to export list explicitly. This did most of the trick.From this I assume that most functions ‘work’ (i.e. The application tldr.pl can access them with unqualified names) . Later, he tells us that all the exceptions are in third party (‘not really mine’) modules which do not have use EXPORTER. It is reasonable to assume that these modules do not have an appropriate ‘import’ function. At least three solutions have been proposed. Any one of them would ‘work’ . None of them are exactly what the OP was hoping for.
The second and third option are probably not available for third party modules. The first option has the advantage that all extra code is added to the ‘proxy’ module ‘ModAll’. This method fails to meet the OP's expectations only because the proxy module must be manually updated every time the library of third party functions is reorganized. Demo of ‘manual’ methodModification of Re: One module to use them all (proxy moudle that exports subs of other modules) The following files are unchanged
EXPORTER has been removed from Mod3.pm to simulate a 'third party' module.
Manual ‘import’ added to ModAll.pm
Bill
In reply to Re^2: One module to use them all (proxy moudle that exports subs of other modules)
by BillKSmith
|
|