I have the following Perl script counting the number of Fs and Ts in a string:
my $str = \"GGGFFEEIIEETTGGG\"; my $ft_count = 0; $ft_count++ while($str =~ m/
You can combine line 2, 3 and 4 into one like so:
my $str = "GGGFFEEIIEETTGGG"; print $str =~ s/[FT]//g; #Output 4;