


base(3p)         Perl Programmers Reference Guide        base(3p)


NAME
       base - Establish IS-A relationship with base class at com-
       pile time

SYNOPSIS
           package Baz;
           use base qw(Foo Bar);

DESCRIPTION
       Roughly similar in effect to

           BEGIN {
               require Foo;
               require Bar;
               push @ISA, qw(Foo Bar);
           }

       Will also initialize the fields if one of the base classes
       has it.  Multiple Inheritence of fields is NOT supported,
       if two or more base classes each have inheritable fields
       the 'base' pragma will croak.  See fields, public and pro-
       tected for a description of this feature.

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

       If any of the base classes are not loaded yet, base
       silently "require"s them (but it won't call the "import"
       method).  Whether to "require" a base class package is
       determined by the absence of a global $VERSION in the base
       package.  If $VERSION is not detected even after loading
       it, base will define $VERSION in the base package, setting
       it to the string "-1, set by base.pm".

HISTORY
       This module was introduced with Perl 5.004_04.

CAVEATS
       Due to the limitations of the pseudo-hash implementation,
       you must use base before you declare any of your own
       fields.

SEE ALSO
       fields












perl v5.8.2                 2002-11-06                          1


