title: Perl: RegEx: ManyLines: Store text between start and end in an array
body: <p>I'm developing a Perl script and one of the script functions is to detect many lines of data between two terminals and store them in an array.</p>
  
  <pre><code>my @statistics_of_layers_var;
  for( &lt;ALL_FILE&gt; ) {
     @statistics_of_layers_var = ($slurp =~ /(Statistics\s+Of\s+Layers)(\n|.)*(Summary)/gm );
     print @statistics_of_layers_var;
  </code></pre>
  
  <p>The given data should be</p>
  
  <pre><code>Statistics Of Layers
  Line#1
  Line#2
  Line#3
  Summary
  </code></pre>
  
  <p>In this piece of code, code successfully prints <strong>Statistics Of Layers</strong> and <strong>Summary</strong> but it fails to print all data between those two terminals.</p>
  
  <p>How could I fix this issue?</p>