in reply to Re: to sort hash wrt values corresponding to keys
in thread to sort hash wrt values corresponding to keys

my %input_hash = (key1,2,key2,3,key3,1); code:

foreach (sort {$input_hash{$a} <=> $input_hash{$b}} keys %input_hash){ print "$input_hash{$_} \n"; }

if at all thats what you wanted.
  • Comment on Re^2: to sort hash wrt values corresponding to keys

Replies are listed 'Best First'.
Re^3: to sort hash wrt values corresponding to keys
by ansh batra (Friar) on Nov 02, 2011 at 06:36 UTC
    thanks ramprasad!!
    this would be enough for me