in reply to A question of inheritance
@ISA only inherits method calls, not subroutines. If you don't have ->, then @ISA doesn't trigger.
Update: And even the ubiquitous @ISA=qw(Exporter) is an abuse of inheritance and causes problems. All of the modules that inherit from Exporter.pm should be changed to just do:
so that they "inherit" just the one function from Exporter that they want.*import= \&Exporter::import;
[Update: ...but don't run off and do this in your own modules just yet! Complete support for this requires some minor patching of Exporter.pm. Worse, you probably won't notice a problem with your module after you make this change so you'll think you are safe until some user of your module tries "require Your::Module 1.05" (or some other feature of Exporter that doesn't currently work without the inheritance sledge having been applied). ]
This problem has been improved a bit lately by, for example, DynaLoader.pm doing
instead of inheriting. But I think the documentation for these core modules should be changed to suggest importing the one function you need instead of inheriting willy nilly. - tye (but my friends call me "Tye")*AUTOLOAD = \&AutoLoader::AUTOLOAD;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: A question of inheritance
by Dominus (Parson) on Nov 28, 2000 at 23:56 UTC | |
by tye (Sage) on Nov 29, 2000 at 00:13 UTC | |
|
Re: (tye)Re: A question of inheritance
by merlyn (Sage) on Nov 28, 2000 at 23:31 UTC |