And of course, you don't have to split the string into a list:
my $sum = 0; while ( $word =~ /(.)/g ) { $sum += $freq{ $1 }; } print "Sum: $sum\n";
In reply to Re: Alphabetical values
by jwkrahn
in thread Alphabetical values
by perlish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |