http://www.perlmonks.org?node_id=636077


in reply to convert letters into a number

Somehow shorter :
use List::Util qw/sum/; my %h; @h{'A' .. 'Z', 0 .. 9} = (1 .. 26, 0 .. 9); my $num = sum @h{map uc, split //, $letters};