in reply to foreach (each character in string..)?
while($str =~ /\G(.)/gs) { ... } ## or with substr() my $i = 0; while( defined(my $c = substr $str, $i++, 1 )) { ... } [download]
_________broquaint