ravishi has asked for the wisdom of the Perl Monks concerning the following question:
and I want 3000 to be a key that returns 9.my %hash = (-5189 => 63, -3213 => 9, -2357 => 3);
I tried putting the hash into an array, sorting it, and then putting it back into an hash. But I couldn't figure out the correct way to do it. It seems like there could be a function to do this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting In-between values in a hash (interpolating)
by dreadpiratepeter (Priest) on Sep 26, 2008 at 21:01 UTC | |
by ikegami (Patriarch) on Sep 26, 2008 at 21:13 UTC | |
by TGI (Parson) on Sep 26, 2008 at 21:45 UTC | |
|
Re: Setting In-between values in a hash (interpolating)
by ikegami (Patriarch) on Sep 26, 2008 at 21:03 UTC | |
by dreadpiratepeter (Priest) on Sep 26, 2008 at 21:28 UTC | |
|
Re: Setting In-between values in a hash (interpolating)
by JavaFan (Canon) on Sep 26, 2008 at 21:03 UTC | |
|
Re: Setting In-between values in a hash (interpolating)
by Fletch (Bishop) on Sep 26, 2008 at 21:09 UTC |