=head1 SYNOPSIS
use File::Glob ':glob';
-
+
@list = bsd_glob('*.[ch]');
$homedir = bsd_glob('~gnat', GLOB_TILDE | GLOB_ERR);
-
+
if (GLOB_ERROR) {
# an error occurred reading $homedir
}
## override the core glob forcing case insensitivity
use File::Glob qw(:globally :nocase);
my @sources = <*.{c,h,y}>;
-
+
## glob on all files in home directory
use File::Glob ':globally';
my @sources = <~gnat/*>;
=head1 DESCRIPTION
-The glob angle-bracket operator <> is a pathname generator that implements the
-rules for file name pattern matching used by Unix-like shells such as the
-Bourne shell or C shell.
+The glob angle-bracket operator C<< <> >> is a pathname generator that
+implements the rules for file name pattern matching used by Unix-like shells
+such as the Bourne shell or C shell.
File::Glob::bsd_glob() implements the FreeBSD glob(3) routine, which is
a superset of the POSIX glob() (described in IEEE Std 1003.2 "POSIX.2").
=head2 META CHARACTERS
- \ Quote the next metacharacter
- [] Character class
- {} Multiple pattern
- * Match any string of characters
- ? Match any single character
- ~ User name home directory
-
-The metanotation ``a{b,c,d}e'' is a shorthand for ``abe ace ade''. Left
-to right order is preserved, with results of matches being sorted sepa-
-rately at a low level to preserve this order. As a special case `{', `}',
-and `{}' are passed undisturbed.
+ \ Quote the next metacharacter
+ [] Character class
+ {} Multiple pattern
+ * Match any string of characters
+ ? Match any single character
+ ~ User name home directory
+
+The metanotation C<a{b,c,d}e> is a shorthand for C<abe ace ade>. Left to
+right order is preserved, with results of matches being sorted separately
+at a low level to preserve this order. As a special case C<{>, C<}>, and
+C<{}> are passed undisturbed.
=head2 POSIX FLAGS
=item *
-If you want to use multiple patterns, e.g. C<bsd_glob "a* b*">, you should
-probably throw them in a set as in C<bsd_glob "{a*,b*}">. This is because
+If you want to use multiple patterns, e.g. C<bsd_glob("a* b*")>, you should
+probably throw them in a set as in C<bsd_glob("{a*,b*}")>. This is because
the argument to bsd_glob() isn't subjected to parsing by the C shell.
Remember that you can use a backslash to escape things.