in reply to @ISA vs. base

Using base.pm has the following differences from just pushing the classes onto @ISA:

1) It initialises the %FIELDS hash if one of the base classes has it.

2) Note that because of this multiple inheritance is not supported when using base.pm (Update: this restriction only applies when also using fields -- see link below.)

3) When strict 'vars' is in scope, using base also lets you assign to @ISA without having to declare @ISA with the 'vars' pragma first.

See also http://www.perl.com/doc/manual/html/lib/fields.html

One world, one people

Replies are listed 'Best First'.
Re^2: @ISA vs. base
by nothingmuch (Priest) on Jul 25, 2005 at 16:00 UTC
    Correction - multiple inheritence is supported, multiple inheritence from two classes which use fields is not (one parent with, the rest without is OK, IIRC).

    By the way this limitation should go away in perl 5.10 since 5.9 no longer uses pseudohashes for this stuff.

    -nuffin
    zz zZ Z Z #!perl