boom has asked for the wisdom of the Perl Monks concerning the following question:
I need to write a Perl script to read in a file, and delete anything inside < >, even if they're on different lines. That is, if the input is:
Hello, world. I <enjoy eating bagels. They are quite tasty.I prefer when I ate a bagel to when I >ate a sandwich. bananas. I want the output to be: Hello, world. I ate a sandwich. bananas. I know how to do this if the text is on 1 line with a regex. But I don't know how to do it with multiple lines. Ultimately I need to be able to conditionally delete parts of a template so I can generate parametrized files for config files. I thought perl would be a good language but I am still getting the hang of it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I delete characters between < and > in Perl?
by Anonymous Monk on Apr 18, 2009 at 13:54 UTC | |
by Anonymous Monk on Apr 18, 2009 at 14:04 UTC | |
by kyle (Abbot) on Apr 18, 2009 at 16:39 UTC | |
by Your Mother (Archbishop) on Apr 18, 2009 at 16:44 UTC | |
|
Re: How can I delete characters between < and > in Perl?
by roboticus (Chancellor) on Apr 18, 2009 at 14:00 UTC | |
|
Re: How can I delete characters between < and > in Perl?
by ambrus (Abbot) on Apr 18, 2009 at 21:18 UTC | |
by Anonymous Monk on Apr 19, 2009 at 02:13 UTC |