title: Perl one liner to extract and sum numbers from a file
body: <p>I have a file with data.</p>
  
  <p><em>File:</em></p>
  
  <pre><code>Rows: 2
  ...
  ...
  Rows: 3
  </code></pre>
  
  <p>The command to search for 'Rows'.</p>
  
  <pre><code>perl -ne 'while (/Rows\:/gi) { s/([.]*Rows :)([.]*)/$2/i, s/^ *//; print }'`
  </code></pre>
  
  <p><em>Gives:</em></p>
  
  <pre><code>2
  3
  </code></pre>
  
  <p>I want to sum up the value and give a result as 5 (2+3).</p>
  
  <p>Please help.</p>