in reply to Best 20 after sort

seaver,
You could easily use last to get out of your for loop after 20 items. You could also use Heap::Simple. I have been meaning to write a follow up to Better mousetrap (getting top N values from list X) for a long time explaining how mere mortals can do heap sorting - maybe someday.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: Best 20 after sort
by seaver (Pilgrim) on Oct 20, 2008 at 16:03 UTC
    L~R
    I was using last, but I knew there'd be a more concise way of doing it.
    S