in reply to how do I swap 2 strings in a file?

Add an s modifier (treat as single line) and amend regex to become:
$string =~s /($string_1)(.*?)($string_2)/$3$2$1/gs;

Should work, as far as I can see...

cLive ;-)