I need to write a Perl script to read in a file and delete something inside <>, even if they are on different lines. That is, if the input:
Hello, world. I <enjoy eating
bagels. They are quite tasty.
I prefer when I ate a bagel to
when I >ate a sandwich. <I also
like >bananas.
I want the output to be:
Hello, world. I ate a sandwich. bananas.
I know how to do this if the text is in 1 line with a regular expression. But I do not know how to do this with multiple lines. Ultimately, I need to be able to conditionally delete parts of the template so that I can create parameterized files for configuration files. I thought perl would be a good language, but I still feel it.
Change . More than one instance is also required <>
source
share