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 ]
In Section
Seekers of Perl Wisdom