in reply to One module to use them all (proxy moudle that exports subs of other modules)
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use ModAll; say for m1(), m2(), m3();
Mod1.pm
package Mod1; use warnings; use strict; use Exporter 'import'; our @EXPORT = qw( m1 ); sub m1 { 'm1' } __PACKAGE__
Mod2.pm
package Mod2; use warnings; use strict; use Exporter 'import'; our @EXPORT = qw( m2 ); sub m2 { 'm2' } __PACKAGE__
Mod3.pm
package Mod3; use warnings; use strict; use Exporter 'import'; our @EXPORT = qw( m3 ); sub m3 { 'm3' } __PACKAGE__
ModAll.pm
package ModAll; use warnings; use strict; use Mod1; use Mod2; use Mod3; use Exporter 'import'; our @EXPORT = (@Mod1::EXPORT, @Mod2::EXPORT, @Mod3::EXPORT); __PACKAGE__
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: One module to use them all (proxy moudle that exports subs of other modules)
by nataraj (Sexton) on Sep 02, 2022 at 21:15 UTC | |
Re^2: One module to use them all (proxy moudle that exports subs of other modules)
by nataraj (Sexton) on Sep 02, 2022 at 21:28 UTC | |
by AnomalousMonk (Archbishop) on Sep 03, 2022 at 00:15 UTC | |
by AnomalousMonk (Archbishop) on Sep 02, 2022 at 22:36 UTC | |
by syphilis (Archbishop) on Sep 03, 2022 at 05:56 UTC | |
by pryrt (Abbot) on Sep 04, 2022 at 22:35 UTC |