in reply to Converting multiple lines into single line.
To detect that you are in your multiline section you can use the range operator (meaning "from..to") and regular expressions.
/^war.*[{]/ means a line starting (the ^ means start) by war, followed by any character (the .) many times (the *) and a { ([] contains a list of allowed characters).
/[}]/ is a string containing }.
/^war.*[{]/../^war.*[{]/ checks $_ and is true between war.*{ and }.
You can try this:
while (<DATA>) { if (/^war.*[{]/../[}]/) { $_ = "==> $_"; # Show the matching lines } print; } __DATA__ bla bla war eligible, init =0*DEC0, ev (VARIABLE){1*BIN0,2*DEC3,6*BIN4, & 5*BIN43,6*DEC32, & 5*BIN43,7*DEC32} bla bla
Now the tools you may need to complete the work can be: chomp to remove the newline, and tr to remove a character (or maybe s for a more complex modification)
|
|---|