xref: /openbsd/gnu/usr.bin/perl/win32/bin/perlglob.pl (revision 133306f0)
1#!perl -w
2use File::DosGlob;
3$| = 1;
4while (@ARGV) {
5    my $arg = shift;
6    my @m = File::DosGlob::doglob(1,$arg);
7    print (@m ? join("\0", sort @m) : $arg);
8    print "\0" if @ARGV;
9}
10__END__
11
12=head1 NAME
13
14perlglob.bat - a more capable perlglob.exe replacement
15
16=head1 SYNOPSIS
17
18    @perlfiles = glob  "..\\pe?l/*.p?";
19    print <..\\pe?l/*.p?>;
20
21    # more efficient version
22    > perl -MFile::DosGlob=glob -e "print <../pe?l/*.p?>"
23
24=head1 DESCRIPTION
25
26This file is a portable replacement for perlglob.exe.  It
27is largely compatible with perlglob.exe (the Microsoft setargv.obj
28version) in all but one respect--it understands wildcards in
29directory components.
30
31It prints null-separated filenames to standard output.
32
33For details of the globbing features implemented, see
34L<File::DosGlob>.
35
36While one may replace perlglob.exe with this, usage by overriding
37CORE::glob with File::DosGlob::glob should be much more efficient,
38because it avoids launching a separate process, and is therefore
39strongly recommended.  See L<perlsub> for details of overriding
40builtins.
41
42=head1 AUTHOR
43
44Gurusamy Sarathy <gsar@activestate.com>
45
46=head1 SEE ALSO
47
48perl
49
50File::DosGlob
51
52=cut
53
54