title: Search for string in filename Perl
body: <p>I am currently trying to find a filename that contains a certain string that is requested. For instance, I have a string <code>companyABC</code> and I am looking to search a directory for this string in a file name. I then want it to return the file I am looking for.</p>
  
  <p>I tried the following using regex but that does not get a string it just checks for those letters in any order which I am not looking for:</p>
  
  <pre><code>$foundFile = grep(/[comapnyABC]/i, readdir Dir);
  </code></pre>
  
  <p>Is there a way to search for a certain string within a file in perl and return that file name?</p>