in reply to Works on test but not in real
You are looping through all the directories in @subdirs and for each directory in @subdirs you are finding all the files in all the directories in @subdirs. This seems a bit redundant. Maybe it would be quicker to do the following:
use strict; use warnings; use File::Find::Rule; # find all the subdirectories of a given directory my $directory = "G:/X/"; my $directory_label = "G:/X"; print "Start\n\n"; print "The following directories have files in with names of more than + 250 characters:\n\n"; my @subdirs = File::Find::Rule->directory->in( $directory_label ); foreach (@subdirs){ print "#"; my $directory_current = $_; my $rule = File::Find::Rule->new; $rule->file; $rule->name( '*.*' ); $rule->name( qr/^.{250,1000}$/); my @files = $rule->in( $_ ); foreach(@files){ print $_; } }
|
|---|