$str = 'ABC'; pos($str) = 1; while (/.\G/g) { print $&; } #### use warnings; $str = 'ABC'; pos($str) = 1; while ($str=~/.\G/g) { print $&; } #### print pos($str); #line6 while ($str=~/.\G/g) { print $&; } #### use warnings; $str = 'ABC'; print pos($str); # pos($str) = 1; while ($str=~/.\G/g) { print $&; } #### Use of uninitialized value in print at /home/lanx/B/PL/PM/re_escG.pl line 2. Use of uninitialized value $& in print at /home/lanx/B/PL/PM/re_escG.pl line 5.