Based on choroba's ++reply, here's a (partial?) solution (?) that may be closer to what you want.

tldr.pl:

# from choroba pm#11146644 (modified) use warnings; use strict; use ModAll; print "'$_' \n" for Foo::bar(qw(some stuff)), m1(), m2('whatever'), m3 +;
ModAll.pm:
# from choroba pm#11146644 (modified) package ModAll; use warnings; use strict; # use Data::Dump qw(dd); # for debug use constant USE_ALL => qw(Mod1 Mod2 Mod3 Foo); eval "use $_" for USE_ALL; use Exporter 'import'; our @EXPORT = map eval, map "\@${_}::EXPORT", USE_ALL ; __PACKAGE__
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__
Foo.pm (forgot this previously):
# Foo.pm package Foo; use strict; use warnings; sub bar { sprintf "hiya from -%s-(@_) invoked from '%s'", (caller 0)[3, 0]; } 1;
Invocation:
Win8 Strawberry 5.8.9.5 (32) Fri 09/02/2022 19:51:48 C:\@Work\Perl\monks\nataraj >perl tldr.pl 'hiya from -Foo::bar-(some stuff) invoked from 'main'' 'm1()' 'm2(whatever)' 'm3()'
(Caution: There may be some important phasing considerations in my version of ModAll.pm that I'm overlooking!)

Update: Forgot to list the Foo.pm module. It's listed elsewhere, but I've added it here for completeness.


Give a man a fish:  <%-{-{-{-<


In reply to Re^3: One module to use them all (proxy moudle that exports subs of other modules) (updated) by AnomalousMonk
in thread One module to use them all (proxy moudle that exports subs of other modules) by nataraj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.