my %description = ( a => 'a vowel', b => 'a consonant', '' => 'not in the alphabet' #description of anything else ); print("a is $description{'a'}\n"); print("b is $description{'b'}\n"); print("~ is $description{'~'}"); #Would like the following: #"~ is not in the alphabet"