in reply to how do I swap 2 strings in a file?
Definitely check out Death to Dot Star!.
Since I haven't really worked with binmode, I don't know what gotchas it introduces. You might want to try using the multiline (m) option on your regex.
Also, a better way to read in your file at one go is:
#Slurp up ORIG { local $/; $string= <ORIG> }
This works by undefing the input record separator, which causes any read from the filehandle to get the whole file. BTW, setting $/="" blank lines are the delimiter.
TGI says moo
|
|---|