in reply to s/// don't delete matching phrase
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.
|
|---|