Line | |
---|
1 | @rem = '--*-Perl-*--
|
---|
2 | @echo off
|
---|
3 | if "%OS%" == "Windows_NT" goto WinNT
|
---|
4 | perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
5 | goto endofperl
|
---|
6 | :WinNT
|
---|
7 | perl -x -S %0 %*
|
---|
8 | if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
|
---|
9 | if %errorlevel% == 9009 echo You do not have Perl in your PATH.
|
---|
10 | if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
|
---|
11 | goto endofperl
|
---|
12 | @rem ';
|
---|
13 | #!perl -w
|
---|
14 | #line 15
|
---|
15 | use File::DosGlob;
|
---|
16 | $| = 1;
|
---|
17 | while (@ARGV) {
|
---|
18 | my $arg = shift;
|
---|
19 | my @m = File::DosGlob::doglob(1,$arg);
|
---|
20 | print (@m ? join("\0", sort @m) : $arg);
|
---|
21 | print "\0" if @ARGV;
|
---|
22 | }
|
---|
23 | __END__
|
---|
24 |
|
---|
25 | =head1 NAME
|
---|
26 |
|
---|
27 | perlglob.bat - a more capable perlglob.exe replacement
|
---|
28 |
|
---|
29 | =head1 SYNOPSIS
|
---|
30 |
|
---|
31 | @perlfiles = glob "..\\pe?l/*.p?";
|
---|
32 | print <..\\pe?l/*.p?>;
|
---|
33 |
|
---|
34 | # more efficient version
|
---|
35 | > perl -MFile::DosGlob=glob -e "print <../pe?l/*.p?>"
|
---|
36 |
|
---|
37 | =head1 DESCRIPTION
|
---|
38 |
|
---|
39 | This file is a portable replacement for perlglob.exe. It
|
---|
40 | is largely compatible with perlglob.exe (the Microsoft setargv.obj
|
---|
41 | version) in all but one respect--it understands wildcards in
|
---|
42 | directory components.
|
---|
43 |
|
---|
44 | It prints null-separated filenames to standard output.
|
---|
45 |
|
---|
46 | For details of the globbing features implemented, see
|
---|
47 | L<File::DosGlob>.
|
---|
48 |
|
---|
49 | While one may replace perlglob.exe with this, usage by overriding
|
---|
50 | CORE::glob with File::DosGlob::glob should be much more efficient,
|
---|
51 | because it avoids launching a separate process, and is therefore
|
---|
52 | strongly recommended. See L<perlsub> for details of overriding
|
---|
53 | builtins.
|
---|
54 |
|
---|
55 | =head1 AUTHOR
|
---|
56 |
|
---|
57 | Gurusamy Sarathy <[email protected]>
|
---|
58 |
|
---|
59 | =head1 SEE ALSO
|
---|
60 |
|
---|
61 | perl
|
---|
62 |
|
---|
63 | File::DosGlob
|
---|
64 |
|
---|
65 | =cut
|
---|
66 |
|
---|
67 |
|
---|
68 | __END__
|
---|
69 | :endofperl
|
---|
Note:
See
TracBrowser
for help on using the repository browser.