You can do both, perl will allow you to modify existing file or create new one. It will depend on your requirements. I would suggest you to do following:
- Understand the requirement before thinking on the implementation. In your case one angle of requirement is to find and remove the given block/string but what to do next is missing.
- Once you know what is required, try yourself, at-least give it a shot. If you still are not able to solve your issue, come to the monks with what you have tried. I am sure you will get good response and solutions.
- Before posting the question have look on how to format and post your question. At-least preview it before posting. Bad formatting will make it difficult to comprehend.
Update:Corrected some typo.