File::Zglob(3pm) | User Contributed Perl Documentation | File::Zglob(3pm) |
File::Zglob - Extended globs.
use File::Zglob; my @files = zglob('**/*.{pm,pl}');
WARNINGS: THIS IS ALPHA VERSION. API MAY CHANGE WITHOUT NOTICE
Provides a traditional Unix glob(3) functionality; returns a list of pathnames that matches the given pattern.
File::Zglob provides extended glob. It supports "**/*.pm" form.
my @files = zglob('**/*.[ch]');
Unlike shell's glob, if there's no matching pathnames, () is returned.
A glob pattern also consists of components and separator characters. In a component, following characters/syntax have special meanings.
Otherwise, it matches zero or more sequence of any characters.
src/*.h src/*/*.h src/*/*/*.h src/*/*/*/*.h ...
"example.{foo,bar,baz}" matches "example.foo", "example.bar", and "example.baz"
"**/*" form makes deep recursion by soft link. zglob throw exception if it's deep recursion.
Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>
Most code was translated from gauche's fileutil.scm.
glob_to_regex function is taken from Text::Glob.
File::DosGlob, Text::Glob, gauche's fileutil.scm
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2012-06-15 | perl v5.14.2 |