title: Perl replace nth substring in a string
body: <p>I have a scenario in which I need to replace the nth sub-string in a string. </p>
  
  <p><code>s/sub-string/new-string/g;</code> will replace all the sub strings, but I need to do for a particular occurrence.</p>
  
  <p>Please help me with this.</p>