Sort-Key-Top-PP-0.003

NAME

SYNOPSIS

use Sort::Key::Top::PP 'top';
my @top5 = top 5 => @biglist;

DESCRIPTION

Sort::Key::Top::PP is set of functions for finding the top "n" items in an array by some criteria. It's not as fast as Sort::Key::Top, but it is generally quite a bit faster than sorting the entire array and taking the first "n" items.

This module implements pure Perl equivalents of the following functions as descibed in Sort::Key::Top.

top

topsort

keytop

keytopsort

ntop

ntopsort

nkeytop

nkeytopsort

rtop

rtopsort

rkeytop

rkeytopsort

rntop

rntopsort

rnkeytop

rnkeytopsort

head

nhead

keyhead

nkeyhead

tail

ntail

keytail

nkeytail

By default all functions are exported. If you don't like that, then please specify an explicit list of functions to import, a la: