perl finda text in a file and then a new line addition : <p>Basically my requirement is a replace in a file using perl. The string that to be found is ' = '. The contents of the file should be modified in a way that end of the line where this string is found, it should add one more line as below. Please hep me here. I am not able to find on adding a new line also on how to get the word just before " = ". This has to be replaced in all occurences of the string within the file.</p>

<pre><code>var b = "text"
var c = "integ"
</code></pre>

<p>should be replaced by </p>

<pre><code>var b = "text"
println "the variable b is $b"
var c = "integ"
println "the variable c is $c"
</code></pre>
