in reply to How to store this value in Hash ?

as an aside, you shouldn't really use $a or $b, as they are the default variables used for rolling your own sort functions...
perldoc -f sort