What you're doing here is using symbolic references. Symbolic references are a verybadidea and they should only be used very rarely.

They are such a bad idea that if you're programming with "use strict" turned on (and you should _always_ program with "use strict" turned on) then Perl turns symbolic references into compile time errors.

You very rarely have to use symbolic references (the only example I can think of is to alter the symbol table). You'll be far better off changing your code to use a hash instead.