for (0, -1) { $bar = substr $foo, $_, 1; $foo = substr($foo, $_, 1) = uc bar; }