Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.6 KiB

  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. =head1 NAME
  25. perlglob.bat - a more capable perlglob.exe replacement
  26. =head1 SYNOPSIS
  27. @perlfiles = glob "..\\pe?l/*.p?";
  28. print <..\\pe?l/*.p?>;
  29. # more efficient version
  30. > perl -MFile::DosGlob=glob -e "print <../pe?l/*.p?>"
  31. =head1 DESCRIPTION
  32. This file is a portable replacement for perlglob.exe. It
  33. is largely compatible with perlglob.exe (the Microsoft setargv.obj
  34. version) in all but one respect--it understands wildcards in
  35. directory components.
  36. It prints null-separated filenames to standard output.
  37. For details of the globbing features implemented, see
  38. L<File::DosGlob>.
  39. While one may replace perlglob.exe with this, usage by overriding
  40. CORE::glob with File::DosGlob::glob should be much more efficient,
  41. because it avoids launching a separate process, and is therefore
  42. strongly recommended. See L<perlsub> for details of overriding
  43. builtins.
  44. =head1 AUTHOR
  45. Gurusamy Sarathy <[email protected]>
  46. =head1 SEE ALSO
  47. perl
  48. File::DosGlob
  49. =cut
  50. __END__
  51. :endofperl