in reply to inside-out class and "our @ISA"

The important difference here between using base and manipulating @INC directly is that base attempts to load the named module. If you don't already use Person; elsewhere in your code, you have to do so within the Employee package if you manipulate @INC yourself. That's one reason I prefer to use base myself.

You do have to make a SUPER call within your destructor; Perl's default behavior for method overriding is override only, not override and redispatch.

(One nit is that your use of ref allows non-blessed references. To be stricter, you can use blessed() from Scalar::Util.)

Replies are listed 'Best First'.
Re^2: inside-out class and "our @ISA"
by j1n3l0 (Friar) on Aug 02, 2007 at 17:17 UTC
    So in short:

    * use base for inheritance
    * better to use Scalar::Util::blessed() than ref()
    * and HAVE to call $self->SUPER::DESTROY for destruction

    Thanks for the advice. I find that when I place Person.pm and Employee.pm in separate files I get the desired results ;)