----- Original Message -----
From: Beast <[EMAIL PROTECTED]>
Date: Wednesday, May 31, 2006 1:59 pm
Subject: sorting?

> 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 


 Store your data in forms of Array of Array then sort it.
For example:

my @AoA = (["foo woo","[EMAIL PROTECTED]"],
                       ["bar woz","[EMAIL PROTECTED]"],
                       ["foo qux", "[EMAIL PROTECTED]"],);



foreach my $disp_name ( sort {$a->[0] <=> $b->[0]} @AoA ) {
  # do whatever you like

}

Read more on Perl's data structure in perldoc:

perldoc perldsc

Hope that helps.

Regards,
Edward WIJAYA
SINGAPORE


------------ Institute For Infocomm Research - Disclaimer -------------
This email is confidential and may be privileged.  If you are not the intended 
recipient, please delete it and notify us immediately. Please do not copy or 
use it for any purpose, or disclose its contents to any other person. Thank you.
--------------------------------------------------------

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


Reply via email to