title: perl : Regex while reading a file
body: <p>I have an array of files. Each file with few lines of text, out of which I am trying to get few specific strings through regex in perl</p>
  
  <pre><code>use strict;
  use warnings;
  
  foreach my $myfile (@myFiles) {
      open my $FILE, '&lt;', $myfile or die $!;
      while ( my $line = &lt;$FILE&gt; ) {
          my ( $project, $value1, $value2 ) = &lt;Reg exp&gt;, $line;
          print "Project : $1 \n";
          print "Value1 :  $2 \n";
          print "Value2 :  $3 \n";
      }
      close(FILE);
  }
  </code></pre>
  
  <p><strong>* File Content *</strong></p>
  
  <pre><code>Checking Project foobar
  &lt;few more lines of text here&gt;
  Good Files excluding rules:     15 -   5%
  Bad Files excluding rules:    270 -  95%
  
  &lt;one more line of text here&gt;
  Good Files including rules:     15 -   5%
  Bad Files including rules:    272 -  95%
  &lt;few more lines of text here&gt;
  </code></pre>
  
  <p><strong>* Desired Output *</strong></p>
  
  <pre><code> Project:foobar  
   Value1 : Good Files excluding rules:     15 -   5%
            Bad Files excluding rules:    270 -  95%   
   Value2 : Good Files including rules:     15 -   5%
            Bad Files including rules:    272 -  95%
  </code></pre>