for my $i ($from .. $to) { #### search files print "Zoomstufe ".$i."\n"; my $rule = File::Find::Rule->new(); # count of files to have action my $total_count = 0; $rule->name(@filemask); # set filemasks for search $rule->exec( # this sub is called for each matched file of search sub { my ( $shortfn, $dir, $filename ) = @_; $filename = File::Spec->rel2abs($filename); $total_count++; } ); print "zaehle .....\r"; my @mydirs = map { $_ . $i . "\\" } @dir; $rule->in(@mydirs); #start search in dirs now print "total files: ".$total_count."\r"; print "\n"; }#end-for