@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:

*import= \&Exporter::import;
so that they "inherit" just the one function from Exporter that they want.

[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

*AUTOLOAD = \&AutoLoader::AUTOLOAD;
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")

In reply to (tye)Re: A question of inheritance by tye
in thread A question of inheritance by Adam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.