in reply to One module to use them all (proxy moudle that exports subs of other modules)
package MyMod1; use Exporter::Extensible -exporter_setup => 1; sub foo :Export( :default ) { 42 }
package MyMod2; use Exporter::Extensible -exporter_setup => 1; sub bar :Export( :default ) { 43 }
package MyMod3; use parent qw( MyMod1 MyMod2 );
However, I also recommend that you don't export things by default. It isn't much more to type use MyMod3 ':all'; and then it gives you more flexibility in the future to choose fewer imports.perl -I. -MMyMod3 -E 'say foo'
package MyMod1; use Exporter::Extensible -exporter_setup => 1; sub foo :Export { 42 }
package MyMod2; use Exporter::Extensible -exporter_setup => 1; sub bar :Export { 43 }
package MyMod3; use parent qw( MyMod1 MyMod2 );
perl -I. -MMyMod3=:all -E 'say foo'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: One module to use them all (proxy moudle that exports subs of other modules)
by hippo (Archbishop) on Sep 04, 2022 at 21:40 UTC |