Smells like a bug to me.E:\new>perl -MConstants -wle"print for keys %Constants::;;print XX+YY" Name "main::XX" used only once: possible typo at -e line 1. import YY EXPORT XX BEGIN print() on unopened filehandle XX at -e line 1. E:\new>perl -MUNIVERSAL -MConstants -wle"print for keys %Constants::;; +print XX+YY" import YY EXPORT EXPORT_FAIL EXPORT_OK XX BEGIN 1
In my activeperl5.6.1/5.8.0, UNIVERSAL.pm consists of
I don't know when that happened/changed, but perl is supposed to load UNIVERSAL AUTOMAGICALLY, so you shouldn't need to say use UNIVERSAL;require Exporter; *import = \&Exporter::import; @EXPORT_OK = qw(isa can);
I wanna hear what tye, merlyn and other people in the know have to say.
update: more clues
In Universally unimportant and overused tye saysE:\new>perl -MConstants -wle"print for keys %UNIVERSAL::;;print XX+YY" Name "main::XX" used only once: possible typo at -e line 1. import can isa VERSION print() on unopened filehandle XX at -e line 1.
(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 think it's fairly obvious that you should avoid using the package variables @EXPORT unless you also push @ISA, 'Exporter'; cause you'll have unexpected results (and what's the point of an @EXPORT if you don't wanna export anything).
|
MJD says you can't just make shit up and expect the computer to know what you mean, retardo! ** The Third rule of perl club is a statement of fact: pod is sexy. |
In reply to Re: Tk helps another package to export?
by PodMaster
in thread Tk helps another package to export?
by tall_man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |