home *** CD-ROM | disk | FTP | other *** search
/ Chip: Windows 2000 Professional Resource Kit / W2KPRK.iso / apps / perl / ActivePerl.exe / data.z / perlglob.bat < prev    next >
Encoding:
DOS Batch File  |  1999-10-16  |  1.5 KB  |  68 lines

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