in reply to Using user input to return variable typed.
Along with following the advice you've already been given and working through 2teez's example, I'd recommend taking a look at Perlintro (Variable Types) for information on initializing a hash/accessing its key/value pairs, etc. Getting Started with Perl also covers the tools required to solve this problem.
Don't forget: Copy => Paste doesn't count as learning ;)
In Section
Seekers of Perl Wisdom