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
In reply to Re^3: Different way to use while loop
by dsheroh
in thread Different way to use while loop
by ChuckP
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |