in reply to Exporter (sometimes) doesn't seem to export if it's not first in @ISA
are basically the same asuse Module; -and- use Module qw( ... );
BEGIN { require Module; Module->import(); } -and- BEGIN { require Module; Module->import(qw( ... )); }
Your module doesn't have an import method, so the modules in @ISA are searched for one. Both CGI and Exporter have an import function, so the one that will be called will be controlled by the order of the classes in @ISA.
If you want Exporter's import, put Exporter early enough in @ISA or add the following to your module:
{ no warnings 'once'; *import = \&Exporter::import; }
(For what it's worth, I've always thought Exporter's reliance on inheritance is dumb.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exporter (sometimes) doesn't seem to export if it's not first in @ISA
by mcdave (Beadle) on Apr 15, 2010 at 17:28 UTC |