hartzell has asked for the wisdom of the Perl Monks concerning the following question:

When perl searchers back through the class hiearchy specified by the ISA arrays, will it "use" the modules if they haven't already been imported/required/used? In other words, is it enough to say:
@ISA = qw(Dog::Poodle);
or must (should, ought) I do:
use Dog::Poodle;
@ISA = qw(Dog::Poodle);
Thanks, g.
  • Comment on Does inheritance via @ISA automagically handle "use"-ing the package?

Replies are listed 'Best First'.
Re: Does inheritance via @ISA automagically handle "use"-ing the package?
by Happy-the-monk (Canon) on Aug 22, 2004 at 21:41 UTC

    do try
            use base qw(Dog::Poodle);
    too.

    Then you needn't worry about a use statement before.

    Cheers, Sören

Re: Does inheritance via @ISA automagically handle "use"-ing the package?
by cLive ;-) (Prior) on Aug 22, 2004 at 21:39 UTC

    What results did your get when you tested this idea?

    cLive ;-)

Re: Does inheritance via @ISA automagically handle "use"-ing the package?
by bart (Canon) on Aug 23, 2004 at 08:35 UTC
    No, that's why they came up with use base — it basically does both tasks at once — and at BEGIN time, too.