Commit | Line | Data |
dfb634a9 |
1 | #!perl -w |
2 | use File::DosGlob; |
3 | $| = 1; |
4 | while (@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 | |
14 | perlglob.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 | |
26 | This file is a portable replacement for perlglob.exe. It |
27 | is largely compatible with perlglob.exe (the Microsoft setargv.obj |
28 | version) in all but one respect--it understands wildcards in |
29 | directory components. |
30 | |
31 | It prints null-separated filenames to standard output. |
32 | |
33 | For details of the globbing features implemented, see |
34 | L<File::DosGlob>. |
35 | |
36 | While one may replace perlglob.exe with this, usage by overriding |
37 | CORE::glob with File::DosGlob::glob should be much more efficient, |
38 | because it avoids launching a separate process, and is therefore |
39 | strongly recommended. See L<perlsub> for details of overriding |
40 | builtins. |
41 | |
42 | =head1 AUTHOR |
43 | |
44 | Gurusamy Sarathy <gsar@umich.edu> |
45 | |
46 | =head1 SEE ALSO |
47 | |
48 | perl |
49 | |
50 | File::DosGlob |
51 | |
52 | =cut |
53 | |