in reply to hash array the key as variable name and value as value

While brsaravan's answer is correct (and requires no strict 'refs"; under strict), the usual answer is "don't".

Symbolic references are fraught with peril, and usually it's much better to use the hash all the time instead.