source: for-distributions/trunk/bin/windows/perl/bin/perlglob.bat@ 14489

Last change on this file since 14489 was 14489, checked in by oranfry, 17 years ago

upgrading to perl 5.8

File size: 1.5 KB
Line 
1@rem = '--*-Perl-*--
2@echo off
3if "%OS%" == "Windows_NT" goto WinNT
4perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
5goto endofperl
6:WinNT
7perl -x -S %0 %*
8if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
9if %errorlevel% == 9009 echo You do not have Perl in your PATH.
10if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
11goto endofperl
12@rem ';
13#!perl -w
14#line 15
15use File::DosGlob;
16$| = 1;
17while (@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
27perlglob.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
39This file is a portable replacement for perlglob.exe. It
40is largely compatible with perlglob.exe (the Microsoft setargv.obj
41version) in all but one respect--it understands wildcards in
42directory components.
43
44It prints null-separated filenames to standard output.
45
46For details of the globbing features implemented, see
47L<File::DosGlob>.
48
49While one may replace perlglob.exe with this, usage by overriding
50CORE::glob with File::DosGlob::glob should be much more efficient,
51because it avoids launching a separate process, and is therefore
52strongly recommended. See L<perlsub> for details of overriding
53builtins.
54
55=head1 AUTHOR
56
57Gurusamy Sarathy <[email protected]>
58
59=head1 SEE ALSO
60
61perl
62
63File::DosGlob
64
65=cut
66
67
68__END__
69:endofperl
Note: See TracBrowser for help on using the repository browser.