Hi
$ cat data
"chandru k" <[EMAIL PROTECTED]>
"prg " <[EMAIL PROTECTED]>
"chandru k" <[EMAIL PROTECTED]>
$ 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 PROTECTED]>
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.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>