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:
Can I do something in one-line perhaps?
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?
Back to
Seekers of Perl Wisdom