GIF89a;
Mass Deface
in that
# namespace.
#
# context (keyed by second cxix arg provided by core)
my %entries;
sub glob {
my($pat,$cxix) = @_;
my @pat;
# glob without args defaults to $_
$pat = $_ unless defined $pat;
# assume global context if not provided one
$cxix = '_G_' unless defined $cxix;
# if we're just beginning, do it all first
if (!$entries{$cxix}) {
# extract patterns
if ($pat =~ /\s/) {
require Text::ParseWords;
@pat = Text::ParseWords::parse_line('\s+',0,$pat);
}
else {
push @pat, $pat;
}
# Mike Mestnik: made to do abc{1,2,3} == abc1 abc2 abc3.
# abc3 will be the original {3} (and drop the {}).
# abc1 abc2 will be put in @appendpat.
# This was just the easiest way, not nearly the best.
REHASH: {
my @appendpat = ();
for (@pat) {
# There must be a "," I.E. abc{efg} is not what we want.
while ( /^(.*)(?;
# from the command line (overrides only in main::)
> perl -MFile::DosGlob=glob -e "print <../pe*/*p?>"
=head1 DESCRIPTION
A module that implements DOS-like globbing with a few enhancements.
It is largely compatible with perlglob.exe (the M$ setargv.obj
version) in all but one respect--it understands wildcards in
directory components.
For example, C<<..\\l*b\\file/*glob.p?>> will work as expected (in
that it will find something like '..\lib\File/DosGlob.pm' alright).
Note that all path components are case-insensitive, and that
backslashes and forward slashes are both accepted, and preserved.
You may have to double the backslashes if you are putting them in
literally, due to double-quotish parsing of the pattern by perl.
Spaces in the argument delimit distinct patterns, so
C