Re: sorting?



Hi

$ cat data
"chandru k" <chk@xxxxxxxxxx>
"prg " <prm@xxxxxxx>
"chandru k" <chjk@xxx>

$ cat script.pl
#!/usr/bin/perl

while(<>)
{
chomp;
($mail,$name)=split(/\t/,reverse($_),2);
$ha{reverse($mail)}=reverse($name);
}
foreach $k(sort values(%ha))
{
print "$k\n";
}

$ ./script.pl data
"chandru k"
"chandru k"
"prg "
Regards,
Chandru

Beast wrote:
Hi,

I have some rather big chunk of data, returned from ldap server. The format is simple:
"Displa name" <email@xxxxxxxx>

Simply displying data "as is" is simple, but how do I sorted by "display name"?
pls note that "display name" contains space and might not unique so I can't put it on %hash.
many thanks.


.