in reply to Alphabetical values
my %freq = ( a => 123, b => 200, c => 700, ... z => 800, ); my $sum = 0; for (split //, $word) { $sum += $freq{$_}; } print "Sum: $sum\n"; [download]
Note that the lookup is case sensitive, so may you need lc or uc to fix that.
See perlintro and perldata.