http://www.perlmonks.org?node_id=400272


in reply to Re^2: Finding oldest file in directory
in thread Finding oldest file in directory

I think what Randal L. Schwartz was referring to, when he said "cache it for the sort," was to use a very common sort optimization technique called, not coincidentally, the Schwartzian Transform.
@sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (-s $_) ] } @unsorted;

--
[ e d @ h a l l e y . c c ]