Thanks poj. I am getting desired result. But the issue I am facing is the inputs are not coming in the order in which they are inserted to the hash. I know hash doesn't store values in order, but is there any way to achieve this ?
Note: I don't have Tie::IxHash; installed on my system and I am not authorized to install this.