perldoc > Search::Dict

πŸ“– NAME

Search::Dict β€” look – search for key in dictionary file

πŸš€ Quick Reference

Use CaseCommandDescription
πŸ” Basic searchlook *FILEHANDLE, $key;Sets file position to first line β‰₯ $key (stringwise).
πŸ”€ Dictionary orderlook *FILEHANDLE, $key, 1;Ignore non-word characters, sort by dictionary order.
πŸ”‘ Case‑insensitivelook *FILEHANDLE, $key, 0, 1;Ignore case when comparing.
πŸ”‘ Hash parameterslook *FILEHANDLE, { dict => 1, fold => 1 };Pass options as a hash reference.
βš™οΈ Custom comparisonlook *FILEHANDLE, { comp => sub { ... } };Use a user‑defined comparison subroutine.

πŸ“ SYNOPSIS

use Search::Dict;
look *FILEHANDLE, $key, $dict, $fold;

use Search::Dict;
look *FILEHANDLE, $params;

πŸ“š DESCRIPTION

Sets file position in FILEHANDLE to be first line greater than or equal (stringwise) to $key. Returns the new file position, or -1 if an error occurs.

The flags specify dictionary order and case folding:

πŸ”‘ If there are only three arguments and the third argument is a hash reference, the keys of that hash can have values "dict", "fold", and "comp" or "xfrm" (see below), and their corresponding values will be used as the parameters.

βš™οΈ If a comparison subroutine (comp) is defined, it must return less than zero, zero, or greater than zero, if the first comparand is less than, equal, or greater than the second comparand.

πŸ”„ If a transformation subroutine (xfrm) is defined, its value is used to transform the lines read from the filehandle before their comparison.

Search::Dict
πŸ“– NAME πŸš€ Quick Reference πŸ“ SYNOPSIS πŸ“š DESCRIPTION

Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-22 08:55 @216.73.216.206
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!