File::Glob::Windows - glob routine for Windows environment.


  use File::Glob::Windows;
  @list = glob($path);
      local $File::Glob::Windows::encoding = getCodePage();
      local $File::Glob::Windows::sorttype = 0;
      local $File::Glob::Windows::nocase   = 1;
      @list = glob($path);


This glob routines works correctly on Windows environment.

  • Recognize system's current codepage such as 'cp932', It's multibyte character contains '\\' and '/' and '*' and '?' in second byte.

  • Correctly handles current drive and currend cirectory. MS-DOS derived environments has current directory for each drive. current working directory means current directory on current drive. 'G:' means 'G:.' , not 'G:\'.

  • It differs from perlglob.exe, this glob can include the wild-card specification also in the middle part of path.


 perl Makefile.PL
 nmake test
 nmake install

Notice: If you have no make, automatically old nmake.exe is downloaded from site of Microsoft, or to same path of perl. You can check nmake install path by:

 perl -e "print $^X"


glob( $path [,$enc [,\%options]);

This function returns array of path that matches to specified $path.

Third argument is reference of hash that indicate glob option.

meta characters in path spec

 *   Match any string of characters
 ?   Match any single character


This function detect current ANSI Codepage and returrns string such as "cpNNNNNN";

getCodePage_A(), getCodePage_B()

These functions are different implement to get current codepage.



Encoding of current codepage of OS.


  • 1: sort by name.

  • 2: sort by directory,name

  • 3: sort by file,name

  • 4: sort by name descent.

  • other: no sort


  • 0: case sensitive

  • 1: ignore case

default is 1.


perlglob, File::DosGlob, File::Glob


tateisu <>