http://www.perlmonks.org?node_id=1069477


in reply to Replace a string after a word

What you could do is use the built-in string functions like index() and substr(). You could also use regular expressions.