1base(3pm) Perl Programmers Reference Guide base(3pm)
2
3
4
6 base - Establish IS-A relationship with base classes at compile time
7
9 package Baz;
10 use base qw(Foo Bar);
11
13 Allows you to both load one or more modules, while setting up inheri‐
14 tance from those modules at the same time. Roughly similar in effect
15 to
16
17 package Baz;
18 BEGIN {
19 require Foo;
20 require Bar;
21 push @ISA, qw(Foo Bar);
22 }
23
24 If any of the listed modules are not loaded yet, base silently attempts
25 to "require" them (and silently continues if the "require" failed).
26 Whether to "require" a base class module is determined by the absence
27 of a global variable $VERSION in the base package. If $VERSION is not
28 detected even after loading it, <base> will define $VERSION in the base
29 package, setting it to the string "-1, set by base.pm".
30
31 Will also initialize the fields if one of the base classes has it.
32 Multiple inheritence of fields is NOT supported, if two or more base
33 classes each have inheritable fields the 'base' pragma will croak. See
34 fields, public and protected for a description of this feature.
35
37 Base class package "%s" is empty.
38 base.pm was unable to require the base package, because it was not
39 found in your path.
40
42 This module was introduced with Perl 5.004_04.
43
45 Due to the limitations of the implementation, you must use base before
46 you declare any of your own fields.
47
49 fields
50
51
52
53perl v5.8.8 2001-09-21 base(3pm)