in reply to How to amend character count.
$count = $line =~ tr/ACGT//; # count only the ACGT characters in $lin +e $line =~ tr/ACGT//cd; # remove all non-ACGT characters from $l +ine [download]