in reply to Re^2: Does s/\Q$find\E/$replace/g really a plain string replace ?
in thread Does s/\Q$find\E/$replace/g really a plain string replace ?

At the same time you were writting that, I was writting my own /g! Mine doesn't have an infinite loop like yours does, however. Try yours with:

$_ = 'foo bah bar'; $find = 'bah'; $replace = '[bah]'; first time in loop: foo [bah] bar second time in loop: foo [[bah]] bar third time in loop: foo [[[bah]]] bar ...