in reply to foreach (each character in string..)?

If you happen to be working on a particularly large string you can just inch your way across which does away with the temporary list e.g
while($str =~ /\G(.)/gs) { ... } ## or with substr() my $i = 0; while( defined(my $c = substr $str, $i++, 1 )) { ... }
See. perlop, perlre and substr for more info.
HTH

_________
broquaint