in reply to Which one is best for optimization
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); }
|
|---|