SPUG: Re: Another stupid question, hash sorting

Richard Anderson richard at richard-anderson.org
Tue Jul 2 20:45:15 CDT 2002


There are many good examples of various ways to use Perl's sort operator at
http://www.raycosoft.com/rayco/support/perl_tutor.html#sort

See the example "Sort using multiple keys"

You can find this tutorial by going to Google and searching on "perl sort".

Cheers,
Richard
richard at richard-anderson.org
www.richard-anderson.org
www.raycosoft.com
----- Original Message -----
From: "Peter Darley" <pdarley at kinesis-cem.com>
To: "SPUG" <spug-list at pm.org>
Sent: Tuesday, July 02, 2002 4:09 PM
Subject: SPUG: Another stupid question, hash sorting


> Friends,
> I've got another stupid question that I'm hoping someone can answer for
me.
> I want to sort a hash on two values, and have been unsuccessful in my
search
> of the web for info on how to do it.
> Specifically I have a hash containing {Score} and {Name} values, and I
want
> to primarily sort on score, and sort on name where the score is the same.
I
> can do this with a two step sort, but I figured that Perl was probably
cool
> enough to provide a simple way of tackling this.
> Thanks,
> Peter Darley
>
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>      Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list