>>>>> ""Mumia" == "Mumia W " <mumia.w.18.spam> writes:
"Mumia> On 03/13/2007 07:44 PM, Hardly Armchair wrote:
>> Hello List,
>> I have a data structure containing a bunch of strings in different groups:
>> [...]
>> I want these sorted first alphabetically within the group, and then
>> according to the number of member in the group.
>> [...]
"Mumia> This is slightly more compact way to do it:
"Mumia> @s_groups = map { [ sort { $a cmp $b } @$_ ]; } @$groups;
Uh,
sort { $a cmp $b } @input
is just a complex way to say:
sort @input
Since string sorting is the default.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/