Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

News / Blogs

- Perl Buzz
- Perl Iron Man
- Perlsphere
- Planet Perl
- TPF news
- Use Perl

See also

- CPAN
- Perl.org
- Perl.com
- Perl 5 Wiki
- Perl Jobs
- Perl Mongers
- Perl Monks

Contact

- Site designed and maintained by Jon Allen (JJ)
- http://perl.jonallen.info

- View the project page and FAQs

# Search::Dict

Perl 5 version 10.1 documentation
Go to top • Show page index • Download PDF

# Search::Dict

- NAME
- SYNOPSIS
- DESCRIPTION

# NAME

Search::Dict, look - search for key in dictionary file

# 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 $dict is true, search by dictionary order (ignore anything but word characters and whitespace). The default is honour all characters.

If $fold is true, ignore case. The default is to honour case.

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 correponding 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.

Page index

- NAME
- SYNOPSIS
- DESCRIPTION

Recently read

Tools

- Preferences