SYNOPSIS

    use File::Zglob;

    my @files = zglob('**/*.{pm,pl}');

DESCRIPTION

\s-1WARNINGS:\s0 \s-1THIS\s0 \s-1IS\s0 \s-1ALPHA\s0 \s-1VERSION\s0. \s-1API\s0 \s-1MAY\s0 \s-1CHANGE\s0 \s-1WITHOUT\s0 \s-1NOTICE\s0

Provides a traditional Unix glob\|(3) functionality; returns a list of pathnames that matches the given pattern.

File::Zglob provides extended glob. It supports \*(C`**/*.pm\*(C' form.

FUNCTIONS

zglob($pattern) # => list of matched files

my @files = zglob('**/*.[ch]'); Unlike shell's glob, if there's no matching pathnames, () is returned.

Special chars

A glob pattern also consists of components and separator characters. In a component, following characters/syntax have special meanings. When it appears at the beginning of a component, it matches zero or more characters except a period (.). And it won't match if the component of the input string begins with a period. Otherwise, it matches zero or more sequence of any characters. If a component is just **, it matches zero or more number of components that match *. For example, src/**/*.h matches all of the following patterns. src/*.h src/*/*.h src/*/*/*.h src/*/*/*/*.h ... When it appears at the beginning of a component, it matches a character except a period (.). Otherwise, it matches any single character. Specifies a character set. Matches any one of the set. The syntax of chars is the same as perl's character set syntax. There is alternation. \*(L"example.{foo,bar,baz}\*(R" matches \*(L"example.foo\*(R", \*(L"example.bar\*(R", and \*(L"example.baz\*(R"

zglob and deep recursion

\*(C`**/*\*(C' form makes deep recursion by soft link. zglob throw exception if it's deep recursion.

PORTABILITY

Win32

Zglob supports Win32. zglob() only uses '/' as a path separator. Since zglob() accepts non-utf8 strings. \s-1CP932\s0 contains '\' character as a second byte of multibyte chars.

LIMITATIONS

File order is not compatible with shells.

AUTHOR

Tokuhiro Matsuno <tokuhirom \s-1AAJKLFJEF\s0 \s-1GMAIL\s0 \s-1COM\s0>

THANKS TO

Most code was translated from gauche's fileutil.scm.

glob_to_regex function is taken from Text::Glob.

RELATED TO File::Zglob…

File::DosGlob, Text::Glob, gauche's fileutil.scm

LICENSE

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.