Quoting PodMaster quoting me:

(currently, Exporter::import() is called whenever you use a module that doesn't define any import method at all, even it that module doesn't even mention Exporter -- this will probably be "fixed" at some point but with this you can "fix" it now and see if you are using any modules that depend on this "bug").

I was a bit inaccurate there. That is only true if you have already required UNIVERSAL.pm because that file contains:

require Exporter; *import = \&Exporter::import;
which is what causes this surprising behavior.

I really think UNIVERSAL::import needs to be made smarter so that it only calls Exporter::import if called as UNIVERSAL->import( ... ). It is nice that you can do use UNIVERSAL qw( isa can ); but it is not nice to have every package suddenly "inherit" Exporter::import whether it wants to or not just because UNIVERSAL.pm has been required by some other part of the script.

The only other piece of the mystery is that Tk::Widget does require UNIVERSAL; (and probably isn't the only place where UNIVERSAL.pm gets requested as a result of use Tk, but that is where the debugger found it being loaded).

                - tye

In reply to Re^2: Tk helps another package to export? by tye
in thread Tk helps another package to export? by tall_man

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.