in reply to Which one is best for optimization

Sorting is an expensive operation with O(NlogN) complexity while iterating over the data is just O(N).

If you were sorting without a custom comparison block, the sort solution could be faster for small data sets, but as this is not the case... and anyway, you can grep:

for my $file (grep { $hash{$_}{Size} > $sizeLimit } @path) { delete_file($file); }