foreach $a(@letters) { $count = ($string = ~tr/$a//); print $count; }