title: Once I find a string in a file, how can I read all of the lines between two lines in that file
body: <p>I have a file like this - just much bigger:</p>
  
  <pre><code>---------------------
  blah
  moo 
  fubar
  ---------------------
  funkytown
  tic
  tac
  chili cheese hotdog
  heartburn
  ---------------------
  </code></pre>
  
  <p>How can I search for 'tic' and output everything between the 2nd and 3rd set of dashed lines?</p>
  
  <pre><code>block_with_string.pl tic 
  </code></pre>
  
  <p>should output </p>
  
  <pre><code>funkytown
  tic
  tac
  chili cheese hotdog
  heartburn
  </code></pre>
  
  <p>I appreciated <a href="https://stackoverflow.com/questions/1774589/how-can-i-read-all-of-the-lines-between-two-lines-in-a-file-using-perl">this answer</a> for printing all lines between 2 lines - just need an extra step.</p>
  
  <p><em>To be honest, what I have is a continuous logfile of XML/SAP IDOCs.  I've just not had any luck locating any helpful IDOC-centric perl info.</em></p>