$count{$t1}++
This will have the number of occurences of each combination stored in a hash. Think about how it works and you will know where to put it. If not, try out a few locations and observe what happens. Don't forget to print out the hash after all the loops are finished.
my $count=($str2=~ tr/$t1//);
This will count how often the characters in $t1 are in $str2, i.e. if $t1 were "ab" it would count all 'a's and 'b's in $str2. Is that really what you want?
In reply to Re: counting inside the loop
by jethro
in thread counting inside the loop
by sarvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |