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 = (
'keyone' => ['firstvalueone', 'firstvaluetwo],
'secondkey' => ['anothervalueone', 'valuetwoforsecondkey'],
'keythree' => ['thirdvalueone', 'thirdvaluetwo']
);
Can I sort the hash on the second element of the anonymous array?
Output should be:
firstvaluetwo
thirdvaluetwo
valuetwoforsecondkey
Many thanks in advance,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]