title: Matching words in a sentence using Perl?
body: <p>i want to extract words between two words in perl but i dont know i can use regular expression or any lib to do that?</p>
  
  <p>example:</p>
  
  <pre><code>$sen = "A short quick brown fox jumps over the lazy dog running in the market";
  
  @sentence = split / /, $sen;
  foreach my $word (@sentence) {
  
  }        
  </code></pre>
  
  <p>i want to get the words between <strong>brown</strong> and <strong>lazy</strong> together with 2 words from the left and 2 words from the right.</p>
  
  <pre><code>output:
  
  words between: fox jumps over the
  2 words from left: short quick
  2 words from right: dog running
  </code></pre>
  
  <p>how can i come up with the above output?</p>