in reply to Re: How do I alphabetize a list of email addresses by domain?
in thread How do I alphabetize a list of email addresses by domain?

That only sorts @emails by domains. To further sort the addresses within each domain, you'd need something like ...

sort { $a->[2] cmp $b->[2] # by domain first, || $a->[1] cmp $b->[1] # then username }

Update: Oops, missed the ||. Thanks Chmrr.

    --k.


Replies are listed 'Best First'.
Re: Re: Re: How do I alphabetize a list of email addresses by domain?
by Chmrr (Vicar) on Apr 20, 2002 at 14:44 UTC
    That only sorts @emails by domains.

    Quite admittedly. But to quote the original poster:

    How do I alphabetize a list of email addresses by domain?

    ..but I can quite see your point. Anyways, you'll want to plonk an "or" between your two lines of code so that it compiles. :)

    Depending on how much the anonymous monk cares, they may or may not want to go whole hog and use Zaxo's more precise and tolerant answer.

    perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'