use Search::Dict;
look *FILEHANDLE, $key, $dict, $fold;
The
look()
routine sets the file position in
FILEHANDLE
to be the first line greater than or equal (stringwise) to
$key
.
It returns the new file position, or -1 if an error occurs.
If
$dict
is true, the search is in dictionary order (ignoring
everything but word characters and whitespace). If
$fold
is
true, then case is ignored. The file must be sorted into the appropriate order,
using the
-d
and
-f
flags of UNIX
sort
(1), or the equivalent command on non-UNIX
machines. Unpredictable results will otherwise ensue.