Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 16th, 2011  |  syntax: Perl  |  size: 0.41 KB  |  views: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. use File::Find::Rule;
  2. use Win32::Shortcut;
  3. use Spreadsheet::WriteExcel;
  4.  
  5. my $workbook  = Spreadsheet::WriteExcel->new('status.xls');
  6.  
  7. my $worksheet = $workbook->add_worksheet();
  8.  
  9.  
  10. my $base_dir ='E:/files/';
  11.  
  12. my $find_rule = File::Find::Rule->new;
  13.  
  14. #$find_rule->maxdepth(1);
  15.  
  16. $find_rule->name('*.lnk');
  17.  
  18. my @files = $find_rule->in($base_dir);
  19.  
  20. print scalar(@files)."\n";
  21.  
  22. #print join("\n", @files);
  23.