in reply to remove content

Perl programmers normally use regular expressions to solve such a problem. A reasonably good tutorial is available at perlretut. You'll also want to take a look at the substitution operator, s/// discussed in perlop (look for the string s/PATTERN/REPLACEMENT/)

Best, beth