Re: sorting list of array

2005-07-15 Thread Wiggins d'Anconia
MNibble wrote: > 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

Re: sorting list of array

2005-07-15 Thread MNibble
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:

RE: sorting list of array

2005-07-13 Thread Jeff 'japhy' Pinyan
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 t

RE: sorting list of array

2005-07-13 Thread Ankur Gupta
Jeff 'japhy' Pinyan wrote: > On Jul 13, Beast said: > >> 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 mechani

RE: sorting list of array

2005-07-13 Thread Ankur Gupta
Beast wrote: > I have an array: > > > my @employee = ( [29243, 'john', 'John doe'], > [24322, 'jane', 'Jane doe'], > [27282, 'james', 'James doe'] > ); > > > Is there any builtin function in perl to sort the above ar

Re: sorting list of array

2005-07-13 Thread Jeff 'japhy' Pinyan
On Jul 13, Beast said: 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 wo

Re: sorting list of array

2005-07-13 Thread Beast
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 = so

Re: sorting list of array

2005-07-13 Thread Jeff 'japhy' Pinyan
On Jul 13, Beast said: my @employee = ( [29243, 'john', 'John doe'], [24322, 'jane', 'Jane doe'], [27282, 'james', 'James doe'] ); Is there any builtin function in perl to sort the above array based on uid, username or fulname? There is a built-i

sorting list of array

2005-07-13 Thread Beast
I have an array: my @employee = ( [29243, 'john', 'John doe'], [24322, 'jane', 'Jane doe'], [27282, 'james', 'James doe'] ); Is there any builtin function in perl to sort the above array based on uid, username or fulname? -- --beast --