#!/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__
In reply to Re: One module to use them all (proxy moudle that exports subs of other modules)
by choroba
in thread One module to use them all (proxy moudle that exports subs of other modules)
by nataraj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |