installarea.html
来自「perl教程」· HTML 代码 · 共 451 行 · 第 1/2 页
HTML
451 行
<dt><strong><a name="item_name__3d_3e__24name">name => $name</a></strong>
<dd>
<p>The name of the package. If a package with the given name is already
installed, then it will replaced with the new package. This is the
only mandatory attribute.</p>
</dd>
</li>
<dt><strong><a name="item_version__3d_3e__24version">version => $version</a></strong>
<dd>
<p>The version identifier for the given package.</p>
</dd>
</li>
<dt><strong><a name="item_author__3d_3e__24string">author => $string</a></strong>
<dd>
<p>Who the current maintainer of the package is. Should normally be on
the form "Givenname Lastname <<a href="mailto:user@example.com">user@example.com</a>>".</p>
</dd>
</li>
<dt><strong><a name="item_abstract__3d_3e__24string">abstract => $string</a></strong>
<dd>
<p>A short sentence describing the purpose of the package.</p>
</dd>
</li>
<dt><strong><a name="item_blib__3d_3e__24path">blib => $path</a></strong>
<dd>
<p>Pick up files to install from the given <em>blib</em> style directory. The
codebase directory of PPD packages is usually a tarball of this stuff.</p>
</dd>
</li>
<dt><strong><a name="item_files__3d_3e__5c_25hash">files => \%hash</a></strong>
<dd>
<p>A hash describing files and directories to install. The keys are
where to copy files from and the values are install locations. The
install locations selects what type of directory to install into by
prefixing them with an dir identifier followed by a colon. Example:</p>
</dd>
<dd>
<pre>
<span class="string">files</span> <span class="operator">=></span> <span class="operator">{</span>
<span class="string">Foo</span> <span class="operator">=></span> <span class="string">"archlib:Foo"</span><span class="operator">,</span>
<span class="string">"Bar.pm"</span> <span class="operator">=></span> <span class="string">"lib:Bar.pm"</span>
<span class="operator">}</span>
</pre>
</dd>
<dd>
<p>This will install the "Foo" directory into the archlib area and the
"Bar.pm" module into the lib area.</p>
</dd>
</li>
</dl>
<dt><strong><a name="item_uninstall">$area->uninstall( $name )</a></strong>
<dd>
<p>Removes the given package and its installed files. Croaks if no such
package was installed in the first place. Uninstalling a package
might break other packages that depended on features this package
provided.</p>
</dd>
</li>
<dt><strong><a name="item_verify">$area->verify( %opts )</a></strong>
<dd>
<p>Verify that the files of the installed packages are still present and
unmodified.</p>
</dd>
<dd>
<p>In scalar context returns TRUE if all files where still found good.
In array context return key/value pairs suitable for assignment to a
hash. The <code>verified</code> value is the number of files checked. The
<code>missing</code>, <code>modified</code>, <code>wrong_mode</code> tally the files found to be
missing, modified or chmoded.</p>
</dd>
<dd>
<p>The following options are recognized:</p>
</dd>
<dl>
<dt><strong><a name="item_package__3d_3e__24name">package => $name</a></strong>
<dd>
<p>Only verify the given package.</p>
</dd>
</li>
<dt><strong><a name="item_file_cb__3d_3e__5c_26sub">file_cb => \&sub</a></strong>
<dd>
<p>Function called back for each file visited. The function is called
with 3 arguments; the file name, expected md5 checksum and expected
file mode.</p>
</dd>
</li>
<dt><strong><a name="item_badfile_cb__3d_3e__5c_26sub">badfile_cb => \&sub</a></strong>
<dd>
<p>Function called back each time a bad file is found. The first
argument is what kind of badness (same as the status keys in the
return value), the second is the file name and the addtional info
varies depending on kind.</p>
</dd>
</li>
</dl>
<dt><strong><a name="item_packages">$area->packages( @fields )</a></strong>
<dd>
<p>Without arguments returns the sorted list of names of packages
currently installed. In scalar context returns the number of packages
installed, or <a href="../../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if database has not been initialized.</p>
</dd>
<dd>
<p>With arguments return a list of array references each one representing
an installed package. The elements of each array are the fields
requested. The list will be sorted by package name. See
<a href="../../../lib/ActivePerl/PPM/Package.html">the ActivePerl::PPM::Package manpage</a> for what field names are available.</p>
</dd>
</li>
<dt><strong><a name="item_package">$area->package( $id )</a></strong>
<dt><strong>$area->package( $name )</strong>
<dt><strong>$area->package( $name, sloppy => 1 )</strong>
<dd>
<p>Return an package object (see <a href="../../../lib/ActivePerl/PPM/Package.html">the ActivePerl::PPM::Package manpage</a>) for the
given package. Returns <a href="../../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if no such package is installed.</p>
</dd>
<dd>
<p>If no package match the specified name exactly and <code>sloppy</code> is
specified then search again ignoring case and even search for features
provided that match name. The method will croak if this extended
search end up matching multiple packages.</p>
</dd>
</li>
<dt><strong><a name="item_package_id">$area->package_id( $name )</a></strong>
<dd>
<p>Returns the internal identifier for the given package. The package
name much match exactly; case matters. Returns <a href="../../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if no such
package is installed. This is the cheapest way to check if a package
is installed.</p>
</dd>
</li>
<dt><strong>$area->package_id( $name, sloppy => 1 )</strong>
<dd>
<p>Find package even if the name does not match exactly. The package
will be found if the name match without regard to case or if it
provide the given name as a feature. Will croak if multiple packages
match.</p>
</dd>
</li>
<dt><strong><a name="item_feature_have">$area->feature_have( $feature )</a></strong>
<dd>
<p>If one of the installed packages provide the given feature, then the
feature version number is returned. The method returns <a href="../../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if no
package provide the given feature.</p>
</dd>
</li>
<dt><strong><a name="item_package_files">$area->package_files( $id )</a></strong>
<dd>
<p>Returns the list of names for the files that belong to the given
package. In scalar context return the number of files.</p>
</dd>
</li>
<dt><strong><a name="item_package_packlist">$area->package_packlist( $id )</a></strong>
<dd>
<p>Returns the <em>.packlist</em> file for the given package. See
<a href="../../../lib/ExtUtils/Packlist.html">the ExtUtils::Packlist manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_packlists">$area->packlists</a></strong>
<dd>
<p>Returns the list of packages that have <em>.packlist</em> files installed.
In scalar context return a hash reference; the keys are package names
and the values are full paths to the corresponding <em>.packlist</em> file.
This will also pick up packages installed by other means that by PPM.
See <a href="../../../lib/ExtUtils/Packlist.html">the ExtUtils::Packlist manpage</a> for more information about these files. PPM
does not use <em>.packlist</em> files to track the files installed by the
packages it manage, but it keeps them in sync for other tools that
manage modules.</p>
</dd>
</li>
<dt><strong><a name="item_sync_db">$area->sync_db( %opt )</a></strong>
<dd>
<p>Synchronize the state of the PPM database with what modules seems to
be installed in the directories of the current install area. Packages
where all files are gone will also be deleted from the PPM database.</p>
</dd>
<dd>
<p>The following options are recognized:</p>
</dd>
<dl>
<dt><strong><a name="item_keep_package_version__3d_3e__24bool"><code>keep_package_version</code> => $bool</a></strong>
<dd>
<p>If TRUE don't try to update the package version from the version
number of the module with the same name as the pacakge.</p>
</dd>
</li>
</dl>
</dl>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="../../../lib/ActivePerl/PPM/Package.html">the ActivePerl::PPM::Package manpage</a>, <a href="../../../lib/ExtUtils/Packlist.html">the ExtUtils::Packlist manpage</a>.</p>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>none.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?