my @chars = split //, $inp_row; my $cnt = 0; for (@chars) { $cnt++ if ($_ eq $de) }