Array-Lookup

 view release on metacpan or  search on metacpan

Lookup.html  view on Meta::CPAN

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:aks@somewhere.local" />
</head>

<body style="background-color: white">



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a>
    <ul>
      <li><a href="#lookup">lookup</a></li>
      <li><a href="#lookup_error">lookup_error</a></li>
    </ul>
  </li>
  <li><a href="#EXAMPLES">EXAMPLES</a>
    <ul>
      <li><a href="#Using-arrays">Using arrays</a></li>
      <li><a href="#Using-hashes">Using hashes</a></li>
    </ul>
  </li>
  <li><a href="#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="#AUTHOR">AUTHOR</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p><b>Array::Lookup</b> - Lookup strings in arrays or hash tables with abbreviation.</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use Array::Lookup;

    $value = lookup $key, \@keywords, \&amp;notfound, \&amp;toomany;

    $value = lookup $key, \%keywords, \&amp;notfound, \&amp;toomany;

    lookup_error $key, $keywords, $err, $msg;</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<h2 id="lookup"><b>lookup</b></h2>

<p>Lookup <code><i>$key</i></code> in the table <code><i>@keywords</i></code> and return the unambiguously matching keyword, if any. If the second argument is given as a hash array, <code><i>%keywords</i></code>, then lookup a matching key, with abbr...

<p>If there are no matches, invoke <code><i>&amp;notfound</i></code> like this:</p>

<pre><code>    &amp;$notfound( $key, \@keywords, &#39;&#39;);</code></pre>

<p>If there are two or more matches, invoke <code><i>&amp;toomany</i></code> like this:</p>

<pre><code>    &amp;$toomany( $key, \@keywords, \@matches);</code></pre>

<p>If either subroutine is omitted or null, then no special action is taken except that <code>undef</code> is returned for the failed lookup.</p>



( run in 0.759 second using v1.01-cache-2.11-cpan-119454b85a5 )