in reply to Re^2: Better mousetrap (getting top N values from list X)
in thread Better mousetrap (getting top N values from list X)
IIRC the idea was to apply much the same type of logic as occurs with split. Ie the logic that implicitly sets the third argument of the split to be N+1 where N is the number of scalar slots on the LHS of the assignment. I hazzily recall discussion on whether using an explicit slice would also do the same. I think if you trawl the p5p archives for sort and optimize youll find it. I think the basic idea was that
my ($x,$y,$z)=sort @foo; my @top=(sort @foo)[1..$n];
would be special cased somehow.
As for your question about XS, I really have no idea right now. Sorry.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Better mousetrap (getting top N values from list X) (want N)
by tye (Sage) on Feb 03, 2005 at 20:03 UTC | |
by BrowserUk (Patriarch) on Feb 03, 2005 at 22:48 UTC |