develooper Front page | perl.module-authors | Postings from July 2021

Enabling all MY methods of the same name in multiple modules

Thread Next
From:
David Christensen
Date:
July 16, 2021 06:57
Subject:
Enabling all MY methods of the same name in multiple modules
Message ID:
dbf186ee-3ed2-bd8c-30ce-6e42ab91b36f@holgerdanske.com
module-authors:

I have extended EUMM in a Perl distribution by implementing a module 
that overrides various methods in the "MY" package namespace and by 
using that MY override module in Makefile.PL, per "Overriding MakeMaker 
Methods" in:

     https://metacpan.org/pod/ExtUtils::MakeMaker


I would like to split the single distribution into multiple 
distributions.  Multiple distributions will have a MY override module. 
A given MY method may be implemented in multiple modules.  A given 
Makefile.PL may 'use' one or more modules.  Method name collisions are 
expected.  I will architect the distributions to avoid circular 
dependencies.


AIUI simply use'ing modules with the same package namespace and the same 
subroutine (method) names will result in later definitions redefining 
earlier definitions, generating compiler warnings and making the earlier 
definitions inaccessible.


Is there a mechanism to daisy-chain multiple package::subroutine 
definitions such that a MY method call by EUMM will return the 
concatenated results of all definitions?


David

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About