modinfo.html

来自「perl教程」· HTML 代码 · 共 187 行

HTML
187
字号
<?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>ActiveState::ModInfo - Queries about installed perl modules</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__',2);</script>
<h1><a>ActiveState::ModInfo - Queries about installed perl modules</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="#bugs">BUGS</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>ActiveState::ModInfo - Queries about installed perl modules</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
 <span class="keyword">use</span> <span class="variable">ActiveState::ModInfo</span> <span class="string">qw(list_modules find_module)</span><span class="operator">;</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The following functions are provided:</p>
<dl>
<dt><strong><a name="item_find_inc">$path = find_inc( $fname )</a></strong>

<dt><strong>$path = find_inc( $fname, \@inc )</strong>

<dd>
<p>Returns the full path to the given $fname, or <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if not found.</p>
</dd>
</li>
<dt><strong><a name="item_find_module">$path = find_module( $mod )</a></strong>

<dt><strong>$path = find_module( $mod, \@inc )</strong>

<dd>
<p>Returns the full path to the given module, or <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if not found.</p>
</dd>
</li>
<dt><strong><a name="item_fixup_module_case">$mod = fixup_module_case( $mod, %opts )</a></strong>

<dd>
<p>Will for instance change &quot;html::parser&quot; into &quot;HTML::Parser&quot;.  If
multiple mappings are possible return $mod unchanged.  The $mod is
also returned unchanged if the module can't be located.</p>
</dd>
<dd>
<p>The following options are recognized:</p>
</dd>
<dl>
<dt><strong><a name="item_inc__3d_3e__5c_40list"><code>inc</code> =&gt; \@list</a></strong>

<dd>
<p>A list of directories to search for modules.  If not provided it
defaults to all the @INC.</p>
</dd>
</li>
<dt><strong><a name="item_prefix_only__3d_3e__24bool"><code>prefix_only</code> =&gt; $bool</a></strong>

<dd>
<p>If true assume $mod to just be a namespace.  Will just look for
matching directory names, not an actual <em>.pm</em> file.</p>
</dd>
</li>
</dl>
<dt><strong><a name="item_fname2mod">$mod = fname2mod( $fname )</a></strong>

<dd>
<p>Convert an fname to a module module name.  The function might return
<a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if the given $fname does not represent a perl module.</p>
</dd>
</li>
<dt><strong><a name="item_list_modules">%modules = list_modules( %opt )</a></strong>

<dd>
<p>This function will locate all modules (.pm files) and return a list of
module-name/file-location pairs.</p>
</dd>
<dd>
<p>The following options are recognized:</p>
</dd>
<dl>
<dt><strong><code>inc</code> =&gt; \@list</strong>

<dd>
<p>A list of directories to search for modules.  If not provided it
defaults to all the @INC entries that point inside the perl
installation directory ($Config{prefix}).</p>
</dd>
</li>
<dt><strong><a name="item_maxdepth__3d_3e__24n"><code>maxdepth</code> =&gt; $n</a></strong>

<dd>
<p>When to give up when traversing directories, i.e. how many &quot;::&quot;s to
allow in the module name.  The default is 6.  A value of 0 indicate no
limit.</p>
</dd>
</li>
<dt><strong><a name="item_allowdup__3d_3e__24bool"><code>allowdup</code> =&gt; $bool</a></strong>

<dd>
<p>If true return all occurrences or any given module.  If this option is
false or not provided, only the first occurrence of any given module
when traversing <code>inc</code> will be returned.  This should also be the
module that perl would pick up if @INC as the given <code>inc</code>.</p>
</dd>
</li>
<dt><strong><a name="item_namespace__3d_3e__24ns"><code>namespace</code> =&gt; $ns</a></strong>

<dd>
<p>Only modules in the given namespace is returned.  If $ns ends with
&quot;::&quot; only submodules of the given namespace is returned.</p>
</dd>
</li>
</dl>
<dt><strong><a name="item_mod2fname">$fname = mod2fname( $mod )</a></strong>

<dd>
<p>Convert a module name to an fname.</p>
</dd>
</li>
<dt><strong><a name="item_open_inc">$fh = open_inc( $fname )</a></strong>

<dt><strong>$fh = open_inc( $fname, \@inc )</strong>

<dd>
<p>Returns an opened file handle for the given fname, or <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if not
found.  Slightly more efficient than using the standard <a href="../../lib/Pod/perlfunc.html#item_open"><code>open()</code></a>
function on the path returned by find_inc(), but otherwise just the
same.  The file is opened in read-only mode.</p>
</dd>
</li>
<dt><strong><a name="item_open_module">$fh = open_module( $mod )</a></strong>

<dt><strong>$fh = open_module( $mod, \@inc )</strong>

<dd>
<p>Returns an opened file handle for the given module, or <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if not found.</p>
</dd>
</li>
<dt><strong><a name="item_parse_version">$vers = parse_version( $filename )</a></strong>

<dd>
<p>Return the $VERSION of a module using the official ExtUtils::MakeMaker
algorithm.  This is a slightly modified copy of the MakeMaker
function.  The main difference is that it returns a real <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if
no version number is found and do it without producing any warning.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>none.</p>

</body>

</html>

⌨️ 快捷键说明

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