in reply to Globbing uncertainty

glob doesn't take paths, glob takes patterns, and back slashes escape glob meta characters
$ perl -le"print for glob shift" C:\perl\[5]*\bin $ perl -le"print for glob shift" C:\perl\\[5]*\bin C:\perl\5.10.1\bin C:\perl\5.11.1\bin C:\perl\5.12.2\bin $ perl -le"print for glob shift" C:\perl/[5]*\bin C:\perl/5.10.1\bin C:\perl/5.11.1\bin C:\perl/5.12.2\bin
So you need to escape $path_to_dir according to your glob rules or
chdir $path_to_dir ; glob '*.type';
I think glob is neat, but the syntax can get complicated , after all it is a shell mini language, for advanced computer users.

Compare the above example to findrule

$ findrule C:\perl -directory -name ( bin ) C:\perl/5.10.1/bin C:\perl/5.10.1/html/bin C:\perl/5.11.1/bin C:\perl/5.12.2/bin C:\perl/site/5.12.2/bin
I didn't want site or html bin, so trying to fix that
$ findrule C:\perl -directory -name ( bin ) -maxdepth 1 $ findrule C:\perl -directory -name ( bin ) -maxdepth 2 C:\perl/5.10.1/bin C:\perl/5.11.1/bin C:\perl/5.12.2/bin $ perl -MFile::Find::Rule -le"print for File::Find::Rule->new ->direct +ory ->name('bin') ->maxdepth(2) ->in('C:\perl') " C:\perl/5.10.1/bin C:\perl/5.11.1/bin C:\perl/5.12.2/bin
findrule can be adequate, but its not as compact as glob.
$ perl -le"print for glob shift " C:/perl/*/*/*/perl5*exe C:/perl/5.10.1/bin/MSWin32-x86-multi-thread/perl5.10.1.exe C:/perl/5.11.1/bin/MSWin32-x86-multi-thread/perl5.11.1.exe C:/perl/5.12.2/bin/MSWin32-x86-multi-thread/perl5.12.2.exe