The /g modifier already means "while it matches", so you can actually just do $file =~ s/<.*?>//g; (without the while loop). This means that the matched chars won't be interpreted as metacharacters by the second regex.
In reply to Re: s/// don't delete matching phrase
by Eily
in thread s/// don't delete matching phrase
by ChevLucas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |