# glob ## Synopsis ```perl @files = glob('*.pl'); @files = glob('lib/**/*.pm'); @files = <*.txt>; # angle-bracket form ``` ## Description Expands shell-style filename patterns into matching pathnames. Expands the given pattern using shell globbing rules. Supports `*`, `?`, `[charset]`, `{alt1,alt2}` (brace expansion), and `~` (home directory). In list context returns all matches; in scalar context returns the next match (iterating on successive calls with the same pattern). The `` syntax is equivalent to `glob(PATTERN)`. When `File::Glob` is loaded, delegates to `bsd_glob` semantics where whitespace in patterns is treated literally. Otherwise, the default behaviour splits the pattern on whitespace to process multiple globs. Results are returned sorted and deduplicated. ## See also opendir, readdir, File::Glob