for my $i ( 0 .. $max ) { my $c = \substr( $protein, $i, 1 ); # Process $$c etc etc }