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};
|
---|
In Section
Seekers of Perl Wisdom