note
naikonta
Hi, [bradcathey],
<code>
$ cat Common.pm
package Common;
use strict;
use warnings;
use Exporter;
our @ISA = qw(Exporter); # borrows import()
our @EXPORT = qw(show_here);
sub show_here { }
1;
$ cat Main.pm
package Common;
use strict;
use warnings;
use Common;
sub show_me {}
1;
</code>
The caller of <c>Main.pm</c> has direct access to <c>show_me()</c> and <c>show_here()</c> using qualified name,
<code>
Main::show_here; # since exported by default by Common.pm
Main::show_me; # originally in Main.pm
</code>
If the caller has its own <c>use Common</c> then it doesn't have to qualify it, <c>show_here()</c> is enough.
<p>However, if you meant that "a way to include Common.pm in Main.pm so Contact.pm can use <c>show_here</c> directly, then make Main.pm to reexport the function.
<code>
package Main;
....
use Exporter;
use Common;
our @ISA = qw(Exporter); # borrows import()
our @EXPORT = qw(show_here); # just @Common::Export to export
# what ever Common exports.
....
sub show_me {}
1;
</code>
The caller,
<code>
use Main;
Main::show_me();
show_here()
</code>
<div class="pmsig"><div class="pmsig-607636">
<hr size="1" noshade="1">
<p align="right"><small>
<i>Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!</i></small></p>
</div></div>
665118
665147