Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / base.html
blobd365d1205eb441a56fd8d60f645fc90b3296a626
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>base - Establish IS-A relationship with base classes at compile time</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;base - Establish IS-A relationship with base classes at compile time</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <li><a href="#diagnostics">DIAGNOSTICS</a></li>
26 <li><a href="#history">HISTORY</a></li>
27 <li><a href="#caveats">CAVEATS</a></li>
28 <li><a href="#see_also">SEE ALSO</a></li>
29 </ul>
30 <!-- INDEX END -->
32 <hr />
33 <p>
34 </p>
35 <h1><a name="name">NAME</a></h1>
36 <p>base - Establish IS-A relationship with base classes at compile time</p>
37 <p>
38 </p>
39 <hr />
40 <h1><a name="synopsis">SYNOPSIS</a></h1>
41 <pre>
42 package Baz;
43 use base qw(Foo Bar);</pre>
44 <p>
45 </p>
46 <hr />
47 <h1><a name="description">DESCRIPTION</a></h1>
48 <p>Allows you to both load one or more modules, while setting up inheritance from
49 those modules at the same time. Roughly similar in effect to</p>
50 <pre>
51 package Baz;
52 BEGIN {
53 require Foo;
54 require Bar;
55 push @ISA, qw(Foo Bar);
56 }</pre>
57 <p>If any of the listed modules are not loaded yet, <em>base</em> silently attempts to
58 <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_require"><code>require</code></a> them (and silently continues if the <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_require"><code>require</code></a> failed). Whether to
59 <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_require"><code>require</code></a> a base class module is determined by the absence of a global variable
60 $VERSION in the base package. If $VERSION is not detected even after loading
61 it, &lt;base&gt; will define $VERSION in the base package, setting it to the string
62 <code>-1, set by base.pm</code>.</p>
63 <p>Will also initialize the fields if one of the base classes has it.
64 Multiple inheritence of fields is <strong>NOT</strong> supported, if two or more
65 base classes each have inheritable fields the 'base' pragma will
66 croak. See <a href="file://C|\msysgit\mingw\html/lib/fields.html">the fields manpage</a>, <em>public</em> and <em>protected</em> for a description of
67 this feature.</p>
68 <p>
69 </p>
70 <hr />
71 <h1><a name="diagnostics">DIAGNOSTICS</a></h1>
72 <dl>
73 <dt><strong><a name="item_base_class_package__22_25s_22_is_empty_2e">Base class package ``%s'' is empty.</a></strong>
75 <dd>
76 <p>base.pm was unable to require the base package, because it was not
77 found in your path.</p>
78 </dd>
79 </li>
80 </dl>
81 <p>
82 </p>
83 <hr />
84 <h1><a name="history">HISTORY</a></h1>
85 <p>This module was introduced with Perl 5.004_04.</p>
86 <p>
87 </p>
88 <hr />
89 <h1><a name="caveats">CAVEATS</a></h1>
90 <p>Due to the limitations of the implementation, you must use
91 base <em>before</em> you declare any of your own fields.</p>
92 <p>
93 </p>
94 <hr />
95 <h1><a name="see_also">SEE ALSO</a></h1>
96 <p><a href="file://C|\msysgit\mingw\html/lib/fields.html">the fields manpage</a></p>
97 <table border="0" width="100%" cellspacing="0" cellpadding="3">
98 <tr><td class="block" style="background-color: #cccccc" valign="middle">
99 <big><strong><span class="block">&nbsp;base - Establish IS-A relationship with base classes at compile time</span></strong></big>
100 </td></tr>
101 </table>
103 </body>
105 </html>