Re: sort on anonymous array elements as hash values

2002-02-08 Thread birgit kellner
Many thanks to Michael and the others who responded to this query! Needless to say: problem solved. Thanks again, Birgit Kellner --On Mittwoch, 06. Februar 2002 17:59 + Michael Lamertz <[EMAIL PROTECTED]> wrote: > > H, did I make sense? > > -- > If we fail, we wi

Re: sort on anonymous array elements as hash values

2002-02-06 Thread Michael Lamertz
On Wed, Feb 06, 2002 at 05:35:44PM +0100, birgit kellner wrote: > my %hash = ( > 'keyone' => ['firstvalueone', 'firstvaluetwo], > 'secondkey' => ['anothervalueone', 'valuetwoforsecondkey'], > 'keythree' => ['thirdvalueone', 'thirdvaluetwo'] > > ); > > Can I sort the hash

Re: sort on anonymous array elements as hash values

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, birgit kellner wrote: > my %hash = ( > 'keyone' => ['firstvalueone', 'firstvaluetwo], > 'secondkey' => ['anothervalueone', 'valuetwoforsecondkey'], > 'keythree' => ['thirdvalueone', 'thirdvaluetwo'] > > ); > > Can I sort the hash on the second element of the

RE: sort on anonymous array elements as hash values

2002-02-06 Thread Nikola Janceski
oops that should have been @sorted_keys = sort { $hash{$a}[1] cmp $hash{$b}[1] } keys %hash; -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 11:48 AM To: 'birgit kellner'; [EMAIL PROTECTED] Subject: RE: sort on anony

RE: sort on anonymous array elements as hash values

2002-02-06 Thread Nikola Janceski
yes: @sorted_keys = sort { $hash{$a}[2] cmp $hash{$b}[2] } keys %hash; -Original Message- From: birgit kellner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 11:36 AM To: [EMAIL PROTECTED] Subject: sort on anonymous array elements as hash values my %hash = ( 'key