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.
[...]

This is slightly more compact way to do it:

    @s_groups = map { [ sort { $a cmp $b } @$_ ]; } @$groups;
    @s_groups = sort { @$a <=> @$b } @s_groups;

I hope this helps.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to