in reply to Sub Routine Malfunction

OK, so the hash is the most general approach -- and as brother/sister zentara remarks, once you see how many things you can do with them, you wonder how you ever coped without.

In this special case, as brother/sister llancet points out, you could simply use an array, because Perl treats strings which contain digits as numbers (and vice versa).

So much for the wonderous ways of Perl.

From a general programming perspective however, you should worry whether the inputs are valid, especially where a human is involved, as brother/sister apl points out. So your conversion subroutine, whatever its mechanics, ought to check that its input is something it can cope with, and your program needs to be arranged to deal with out of spec input.

I just wanted to stress that, while the coding issues are interesting -- and Perl has its own little ways -- the art of programming is more than coding.