use File::Find; my @drives = ( 'c:/', 'd:/' ); my $kill_find = 0; my $extras = 0; find( sub { $extras++ if $kill_find; $File::Find::prune = 1, return if $File::Find::name =~ m{^.:/System Volume Information$}; $File::Find::prune = 1, return if $kill_find; return if -d $_; # print "$File::Find::name\n" and goto End_F if -s(_) > 100_000_000; print "$File::Find::name\n" and $kill_find=1 if -s(_) > 100_000_000; }, @drives ); End_F: print "Extra files or directories checked by this method: $extras\n";