This code counts number of characters in a single line
how can I make it count(give total X Y Z) it in multiple lines seperated by ">"
while(<IN>) {
chomp;
my @line = split(//, $_);
if($line[0] eq ">"){print @line;}
elsif (($line[0] eq "X"||"Y"||"Z")||($line[0] ne ">"))
{
my %cnter;
foreach my $gc (@line)
{$cnter{$gc} ++;}
print join(" ", @cnter{qw(X Y Z)}), "\n";
}
}
close(IN);
exit;