my $count = 0; &find( sub { $count++; File::Find::breakout() if $count == 500; }, '/');