use warnings; $str = 'ABC'; pos($str) = 1; while ($str=~/.\G/g) { print $&; }