in reply to Efficient walk/iterate along a string
I don't know if this is faster but you could try substr with references, for example:
for my $i ( 0 .. $max ) { my $c = \substr( $protein, $i, 1 ); # Process $$c etc etc } [download]