6

Perl: Find variable text between keywords & replace w/ "term_<variable_text>_term"

view full story
linux-howto

http://www.linuxquestions.org – I am trying to write a Perl script that can open a file, find text that appears between two identifying strings (for now, "start" and "end"), then modify that text by enclosing it between "term_" and "_term" . Since the identified strings vary, the replacement string becomes "term_$1_term". From looking at other threads in this forum I've been able to get as far as spitting out the modified terms using the following code: open FILE, "start2.txt" || die ("Could not open file <br> $!"); $text = < (HowTos)