in reply to How to amend character count.

In addition to chomp, you might enjoy:
$count = $line =~ tr/ACGT//; # count only the ACGT characters in $lin +e $line =~ tr/ACGT//cd; # remove all non-ACGT characters from $l +ine