CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
sorting

 



bench
stranger

Sep 30, 2001, 4:04 AM

Post #1 of 3 (634 views)
sorting Can't Post

how would you sort a list into alphabetical order. With the array '@list', Is it possible to sort it out into alphabetical order?



mhx
Enthusiast / Moderator

Sep 30, 2001, 4:38 AM

Post #2 of 3 (633 views)
Re: sorting [In reply to] Can't Post

This will explicitly sort ASCIIbetically (which is only slightly different from alphabetically in some cases).

Code
@list = sort { $a cmp $b } @list;

Hope this helps.

-- Marcus


Code
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= 
($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"



bench
stranger

Oct 1, 2001, 8:38 AM

Post #3 of 3 (617 views)
Re: sorting [In reply to] Can't Post

Thanks for your help!


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives