FILE: C:\Program Files (x86)\Plesk\perl\lib\File\Glob.pm
--
package File::Glob;
use strict;
our($DEFAULT_FLAGS);
require XSLoader;
# NOTE: The glob() export is only here for compatibility with 5.6.0.
# csh_glob() should not be used directly, unless you know what you're doing.
our %EXPORT_TAGS = (
'glob' => [ qw(
GLOB_ABEND
GLOB_ALPHASORT
GLOB_ALTDIRFUNC
GLOB_BRACE
GLOB_CSH
GLOB_ERR
GLOB_ERROR
GLOB_LIMIT
GLOB_MARK
GLOB_NOCASE
GLOB_NOCHECK
GLOB_NOMAGIC
GLOB_NOSORT
GLOB_NOSPACE
GLOB_QUOTE
GLOB_TILDE
bsd_glob
) ],
);
$EXPORT_TAGS{bsd_glob} = [@{$EXPORT_TAGS{glob}}];
our @EXPORT_OK = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob');
our $VERSION = '1.42';
sub import {
require Exporter;
local $Exporter::ExportLevel = $Exporter::ExportLevel + 1;
Exporter::import(grep {
my $passthrough;
if ($_ eq ':case') {
$DEFAULT_FLAGS &= ~GLOB_NOCASE()
}
elsif ($_ eq ':nocase') {
$DEFAULT_FLAGS |= GLOB_NOCASE();
}
elsif ($_ eq ':globally') {
no warnings 'redefine';
*CORE::GLOBAL::glob = \&File::Glob::csh_glob;
}
elsif ($_ eq ':bsd_glob') {
no strict; *{caller."::glob"} = \&bsd_glob_override;
$passthrough = 1;
}
else {
$passthrough = 1;
}
$passthrough;
} @_);
}
XSLoader::load();
$DEFAULT_FLAGS = GLOB_CSH();
if ($^O =~ /^(?:MSWin32|VMS|os2|riscos)$/) {
$DEFAULT_FLAGS |= GLOB_NOCASE();
}
1;
__END__
=head1 NAME
File::Glob - Perl extension for BSD glob routine
=head1 SYNOPSIS
use File::Glob ':bsd_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 (CORE::glob() does this automatically
## by default anyway, since v5.6.0)
use File::Glob ':globally';
my @sources = <*.{c,h,y}>;
## override the core glob, forcing case sensitivity
use File::Glob qw(:globally :case);
my @sources = <*.{c,h,y}>;
## 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 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").
bsd_glob() takes a mandatory C argument, and an optional
C argument, and returns a list of filenames matching the
pattern, with interpretation of the pattern modified by the C
variable.
Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob().
Note that they don't share the same prototype--CORE::glob() only accepts
a single argument. Due to historical reasons, CORE::glob() will also
split its argument on whitespace, treating it as multiple patterns,
whereas bsd_glob() considers them as one pattern. But see C<:bsd_glob>
under L, below.
=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 C is a shorthand for C. 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 EXPORTS
See also the L below, which can be exported individually.
=head3 C<:bsd_glob>
The C<:bsd_glob> export tag exports bsd_glob() and the constants listed
below. It also overrides glob() in the calling package with one that
behaves like bsd_glob() with regard to spaces (the space is treated as part
of a file name), but supports iteration in scalar context; i.e., it
preserves the core function's feature of returning the next item each time
it is called.
=head3 C<:glob>
The C<:glob> tag, now discouraged, is the old version of C<:bsd_glob>. It
exports the same constants and functions, but its glob() override does not
support iteration; it returns the last file name in scalar context. That
means this will loop forever:
use File::Glob ':glob';
while (my $file = <* copy.txt>) {
...
}
=head3 C
This function, which is included in the two export tags listed above,
takes one or two arguments. The first is the glob pattern. The
second, if given, is a set of flags ORed together. The available
flags and the default set of flags are listed below under L.
Remember that to use the named constants for flags you must import
them, for example with C<:bsd_glob> described above. If not imported,
and C