title: replace a string in config file using perl
body: <p>I have a string having the following format:</p>
  
  <pre><code>ip = 192.168.1.2
  user = test
  password = test0
  </code></pre>
  
  <p><code>ip =</code>, <code>user =</code> and <code>password =</code> are fixed but the strings to the right of the equals signs may vary.</p>
  
  <p>Using Perl, I would like to write a one-line command to replace the string following <code>user =</code> with a given string, say, <code>X</code>, to return the following new string: </p>
  
  <pre><code>ip = 192.168.1.2
  user = X
  password = test0
  </code></pre>
  
  <p>Thanks for your help.</p>