in reply to Re^2: Different way to use while loop
in thread Different way to use while loop
Its a global substitution, so even if it was s/FOO/BAR/g there would be no need to repeat that, the global substitution took care of it in one passNot necessarily:
Without knowing FOO and BAR, we can't say whether new instances of FOO might be created in the string when the substitution is performed.$ perl -E '$_ = "caattt"; s/at//g; say' catt $ perl -E '$_ = "caattt"; 1 while s/at//g; say' ct
|
|---|