I don't think this will work. This assumes that the string to replace takes up a whole line (or chunk based on whatever you've got $/ set to).
If the file looks like this:
1221323asdl;lerTHIS IS THE STRING I WANTasdlf asdajla;sdfasdfasdfass
nothing will happen.
That being said, the above technique is a clever way to change (or slightly modified, insert) whole lines in a file.
TGI says moo
In reply to Re: Re: how do I swap 2 strings in a file?
by TGI
in thread how do I swap 2 strings in a file?
by babyconejo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |