# perldoc > Search::Dict

---
type: CommandReference
command: look
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference

- `look *FILEHANDLE, $key` — set file position to first line ≥ $key (stringwise), default options
- `look *FILEHANDLE, $key, $dict, $fold` — specify dictionary order and case folding
- `look *FILEHANDLE, \%params` — pass options as hash reference (keys: `dict`, `fold`, `comp`, `xfrm`)

## Name

`look` - search for key in dictionary file

## Synopsis

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

use Search::Dict;
look *FILEHANDLE, \%params;
## Options

- `$dict` — boolean; if true, search by dictionary order (ignore anything but word characters and whitespace). Default: honour all characters.
- `$fold` — boolean; if true, ignore case. Default: honour case.
- `comp` — code reference; comparison subroutine returning <0, 0, or >0 if first comparand is less than, equal, or greater than second.
- `xfrm` — code reference; transformation subroutine applied to each line read from the filehandle before comparison.

If the third argument is a hash reference, its keys are used as parameter names (e.g., `{ dict => 1, fold => 1 }`).

## Return Value

Returns the new file position (integer) on success, or `-1` on error.

## See Also

- [Search::Dict on perldoc.perl.org](https://perldoc.perl.org/Search::Dict)