On Jul 13, Ankur Gupta said:
Jeff 'japhy' Pinyan wrote:
Is there any builtin function in perl to sort the above array based
on uid, username or fulname?
my @sorted = sort {
$a->[0] <=> $b->[0]
} @employees;
Hey, This will sort only numbers. Will have no effect if the values have
text.
You're right, but I would expect -- after my explanation of how it works,
and my pointer to the sort() docs -- that the OP would be able to
extrapolate the rest.
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
http://japhy.perlmonk.org/ % have long ago been overpaid?
http://www.perlmonks.org/ % -- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>