in reply to counting protein residues

have you programed in anything else yet? do you understand loops? do you know of regular expressions? would you understand substr?

probably the best way to start would be

use strict; use warnings; my $jpred='--------HHHHHH-----HHHHHHHH------';
https://perldoc.perl.org/functions/length.html
https://perldoc.perl.org/functions/substr.html
http://perldoc.perl.org/functions/print.html