in reply to Adding "sub import{}" to my module makes global symbols require an explicit package name
In addition to what Corion said: With recent perl/Exporter versions (perl >=5.8.3 / Exporter >=5.57), you no longer need to inherit from Exporter, it is sufficient to import Exporter's import routine (see Exporting without inheriting from Exporter). So you can drop the line ...
... and change ...@ISA=qw(Exporter);
... to ...use Exporter;
use Exporter qw( import );
Of course, if you have your own import method, that won't work. You can use export_to_level instead, see Exporting without using Exporter's import method. Inheriting is also not needed then, and you also don't have to (and should not) import Exporter's import.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Adding "sub import{}" to my module makes global symbols require an explicit package name
by BadHarry (Initiate) on Sep 29, 2010 at 09:22 UTC |