Source code of Windows XP (NT5)
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.

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