I have:
A file called 'fooBar'.
A variable called 'myVar', which has the string 'the lazy' assigned to it.
I want to insert $myVar into the file fooBar before the text '</dog>'
fooBar Before:
The quick brown fox jumps over </dog>
fooBarAfter:
The quick brown fox jumps over the lazy </dog>
What is the best way to achieve this please?