http://qs321.pair.com?node_id=714289


in reply to Which one is best for optimization

Solution 1 requires only an iterator to keep track of where you are in the hash. You will visit each entry once, and once only.

Solution 2 requires sorting the list, so at a minimum you are going to visit each entry anyway, and the sort algorithm that takes O(n) time in the general case has yet to be invented. This will take more time, no matter what, and worse, it may potentially all for naught if there are no files that are larger than your limit.

The only sane approach is solution 1.

• another intruder with the mooring in the heart of the Perl