home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / netprofessional / code / 02.02 / MacPerl.CheckFileNames.perl.txt < prev    next >
Text File  |  2010-09-21  |  286b  |  13 lines

  1. # CheckFileNames - find unusual (and possibly problematic) file names
  2. #
  3. # prints:  MyDisk:FileTree:foo_bar
  4. #          ...
  5.  
  6. use File::Find;
  7.  
  8. find(\&lookForWeirdNames, "MyDisk:FileTree");  # scan tree
  9.  
  10. sub lookForWeirdNames {
  11.   print  "$File::Find::name\n" if ($_ =~ m/[^A-Za-z0-9\.]/);
  12.  
  13.