in reply to Re: Tk helps another package to export?
in thread Tk helps another package to export?
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:
which is what causes this surprising behavior.require Exporter; *import = \&Exporter::import;
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
|
|---|