Beast wrote:
Jeff 'japhy' Pinyan wrote:
Is there any builtin function in perl to sort the above array based
on uid, username or fulname?
There is a built-in function to sort a list, yes. But the mechanism
by which to sort the list is, in this case, up to you to provide.
This works:
my @sorted = sort {
$a->[0] <=> $b->[0]
} @employees;
Thank you.
However, is this scalable if, for example list is more than 5000 ?
(ie. obtain data from ldap which we can not ask data provider to sort
the entry for us)
if speed (scale) is a problem ... ask someone how has the book effective
perl - there is a the "schwarz" sort code, which usage caching for speed
up. ( Randel Schwarz is also on that list .. so maybe ... he can pass it
anyway ).
with regrads
MNibble
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>