installarea.html

来自「perl教程」· HTML 代码 · 共 451 行 · 第 1/2 页

HTML
451
字号
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../../displayToc.js"></script>
<script language="JavaScript" src="../../../tocParas.js"></script>
<script language="JavaScript" src="../../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../../scineplex.css">
<title>ActivePerl::PPM::InstallArea - Perl installation area</title>
<link rel="stylesheet" href="../../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>

<script>writelinks('__top__',3);</script>
<h1><a>ActivePerl::PPM::InstallArea - Perl installation area</a></h1>
<p><a name="__index__"></a></p>

<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#bugs">BUGS</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>ActivePerl::PPM::InstallArea - Perl installation area</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  <span class="keyword">my</span> <span class="variable">$area</span> <span class="operator">=</span> <span class="variable">ActivePerl::PPM::InstallArea</span><span class="operator">-&gt;</span><span class="variable">new</span><span class="operator">(</span><span class="string">"site"</span><span class="operator">);</span>
  <span class="comment"># or</span>
  <span class="keyword">my</span> <span class="variable">$area</span> <span class="operator">=</span> <span class="variable">ActivePerl::PPM::InstallArea</span><span class="operator">-&gt;</span><span class="variable">new</span><span class="operator">(</span><span class="string">prefix</span> <span class="operator">=&gt;</span> <span class="string">"$ENV{HOME}/perl"</span><span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>An <code>ActivePerl::PPM::InstallArea</code> object provide an interface to a
Perl install area.  Different install areas might have different
protection policies and each contain a set of installed packages and
modules.  The concept is the same as <code>INSTALLDIRS</code> provided by
<a href="../../../lib/ExtUtils/MakeMaker.html">the ExtUtils::MakeMaker manpage</a>.</p>
<p>An install area is divided into the following directories:</p>
<dl>
<dt><strong><a name="item_lib">lib</a></strong>

<dd>
<p>This is where architecture neutral modules go.  Packages that
are implemented in pure perl are installed here.</p>
</dd>
</li>
<dt><strong><a name="item_archlib">archlib</a></strong>

<dd>
<p>This is where architecture specific modules go.  Packages that are
implemented using XS code are installed here.  For ActivePerl this
will normally be the same as <a href="#item_lib"><code>lib</code></a>.</p>
</dd>
</li>
<dt><strong><a name="item_script">script</a></strong>

<dd>
<p>This is where architecture neutral programs go.</p>
</dd>
</li>
<dt><strong><a name="item_bin">bin</a></strong>

<dd>
<p>This is where architecture specific programs go.  For ActivePerl this
will normally be the same as <a href="#item_script"><code>script</code></a>.</p>
</dd>
</li>
<dt><strong><a name="item_etc">etc</a></strong>

<dd>
<p>This is where configuration files go.</p>
</dd>
</li>
<dt><strong><a name="item_man1">man1</a></strong>

<dd>
<p>This is where Unix style manual pages describing programs go.</p>
</dd>
</li>
<dt><strong><a name="item_man3">man3</a></strong>

<dd>
<p>This is where Unix style manual pages describing modules go.</p>
</dd>
</li>
<dt><strong><a name="item_html">html</a></strong>

<dd>
<p>This is where HTML files go.</p>
</dd>
</li>
<dt><strong><a name="item_prefix">prefix</a></strong>

<dd>
<p>This just provide a prefix for the install area as a whole.  All paths
above should be at or below <a href="#item_prefix"><code>prefix</code></a>.</p>
</dd>
</li>
</dl>
<p>The following methods are provided:</p>
<dl>
<dt><strong><a name="item_new">$area = ActivePerl::PPM::InstallArea-&gt;new( $name )</a></strong>

<dt><strong>$area = ActivePerl::PPM::InstallArea-&gt;new( %opts )</strong>

<dd>
<p>Constructs a new <code>ActivePerl::PPM::InstallArea</code> object.  If constructed
based on $name, then the constructor might croak if no
install area with the given name is known.  The &quot;perl&quot; and &quot;site&quot; install areas
are always available.  Some perls might also have a &quot;vendor&quot; install area.</p>
</dd>
<dd>
<p>Alternatively the directories to use can be specified directly by
passing them as key/value pair %opts.  Only <a href="#item_prefix"><code>prefix</code></a> is mandatory.
All other directories are derived from this, except for the <code>man*</code>
directories will only set up if specified explicitly.</p>
</dd>
<dd>
<p>The option <code>autoinit</code> will if TRUE make the install area call
$self-&gt;initialize automatically when some method need access to the
database.</p>
</dd>
</li>
<dt><strong><a name="item_name">$area-&gt;name</a></strong>

<dd>
<p>Returns the name.  This returns the empty string for nameless <em>InstallArea</em>.</p>
</dd>
</li>
<dt><strong>$area-&gt;prefix</strong>

<dt><strong>$area-&gt;archlib</strong>

<dt><strong>$area-&gt;lib</strong>

<dt><strong>$area-&gt;bin</strong>

<dt><strong>$area-&gt;script</strong>

<dt><strong>$area-&gt;man1</strong>

<dt><strong>$area-&gt;man3</strong>

<dt><strong>$area-&gt;html</strong>

<dt><strong>$area-&gt;etc</strong>

<dd>
<p>Returns the corresponding path.</p>
</dd>
</li>
<dt><strong><a name="item_inc">$area-&gt;inc</a></strong>

<dd>
<p>Returns the list of directories to be pushed onto perl's @INC for the
current install area.</p>
</dd>
</li>
<dt><strong><a name="item_initialized">$area-&gt;initialized</a></strong>

<dd>
<p>Returns TRUE if this area has been initialized.  If <code>autoinit</code> was
specified for the constructor, then this method might have the side
effect of actually initializing the database, in which case this
returns TRUE.</p>
</dd>
</li>
<dt><strong><a name="item_initialize">$area-&gt;initialize</a></strong>

<dd>
<p>Set up the database used to track packages for the install area if not
already set up.  This invokes <a href="#item_sync_db"><code>sync_db()</code></a> if the database was created.</p>
</dd>
<dd>
<p>Most methods will croak unless the install area has been initialized.
Exceptions are name(), readonly(), initialized(), <a href="#item_packages"><code>packages()</code></a> and the
directory accessors (like lib(), script(),...).</p>
</dd>
<dd>
<p>The <code>autoinit</code> option can be specified for the constructor to make
the database be automatically set up on during the first method call
than need it.</p>
</dd>
</li>
<dt><strong><a name="item_readonly">$area-&gt;readonly</a></strong>

<dd>
<p>Returns TRUE if it is not possible to install or remove packages from
the area.  This is usually caused by the user does not have permission
to modify the files of the area.</p>
</dd>
<dd>
<p>This also returns TRUE for unintialized install areas.</p>
</dd>
</li>
<dt><strong><a name="item_install">$area-&gt;install( packages =&gt; [\%pkg1, \%pkg2, ...] )</a></strong>

<dd>
<p>Install the given list of packages as one atomic operation.  The
function returns TRUE if all packages installed or FALSE if
installation failed.</p>
</dd>
<dd>
<p>Each package to be installed is described by a hash reference (or an
<a href="../../../lib/ActivePerl/PPM/Package.html">the ActivePerl::PPM::Package manpage</a> object) with the following elements:</p>
</dd>
<dl>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?