http://www.perlmonks.org?node_id=835544

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hey there monks!
I need your wisdom in order to write the following snippet of code using less lines.
The purpose is to count only the letters (not the -) in the given string.
My way is:
$str='ABC---DR----EEEEEGGGG-GRE-RED----KKKK---'; $seq_no_dash=$str; $seq_no_dash=~s/-//g; $len_seq=length($seq_no_dash);

Can I do something in one-line perhaps?