I have a hash
%value
g=>10
i=>55
k=>4
n=>100
I have an array
@letters = ('k','i','n','g')
please let me know how to sort my hash in the order of keys in the array.
If you want to print hash values in order in which they appear in @letters
array then,
print join ",", @value{@letters};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With