my $str = "ARKL---MNRD--SET"; print "$str [- count]: ", $str =~ tr/-//, $/; __output__ ARKL---MNRD--SET [- count]: 5