title: Perl regular expression loop through all the directory and get specific file
body: <p>I would like to translate the unix regular expression into Perl language to get some specific file associated with some condition.</p>
  
  <p>Suppose now I have Perl script in a directory <code>/nfs/cs/test_case/y2016</code> call totalResult.pl, this directory also contains lot of directories as well such as testWeek1, testWeek2, testWeek3...etc. Each directory contain sub-directory such as testCase1, testCase2, testCase3...etc. and Each testCase directory contains a file call .test_result, the contain record the result either success or fail.</p>
  
  <p>So I can get the file information using unix command, for example:</p>
  
  <pre><code>wc /nfs/cs/test_case/y2016/testWeek1/testCase1/.test_result
  </code></pre>
  
  <p>If would like to get the test_results for each directory and sub-directory which is fail, I can do it from the current path <code>/nfs/cs/test_case/y2016</code> in unix like:</p>
  
  <pre><code>grep -ri "fail" */*/.test_result
  </code></pre>
  
  <p>It will give me the output:</p>
  
  <pre><code>/nfs/cs/test_case/y2016/testWeek1/testCase1/.test_result:fail
  /nfs/cs/test_case/y2016/testWeek3/testCase45/.test_result:fail
  /nfs/cs/test_case/y2016/testWeek4/testCase12/.test_result:fail
  .
  .
  ...etc
  </code></pre>
  
  <p>How can I achieve it in writing a Perl script just run the command <code>perl testCase.pl</code> then can get the same output? I'm new in unix and Perl, anyone can help?</p>