title: How to find files/folders recursively in Perl script?
body: <p>I have a perl script which I have written to search files present in my windows folders, recursively. I enter the search text as the perl script runtime argument to find a file having this text in it's name. The perl script is as below:</p>
  
  <pre><code>use Cwd;
  
  $file1 = @ARGV[0];    
  
  #@res1 = glob "*test*";
  #@res1 = glob "$file1*";
  @res1 = map { Cwd::abs_path($_) } glob "$file1*";
  foreach (@res1)
  {
      print "$_\n";
  }
  </code></pre>
  
  <p>But this is not searching all the sub-directories recursively. I know <code>glob</code> doesn't match recursively.<br>
  So tried using module <code>File::Find</code> and the function  <code>find(\&amp;wanted,  @directories);</code></p>
  
  <p>But I got a error saying <code>find()</code> undefined. From what I read from help, I thought <code>find()</code> function is defined by default in Perl installation, with some basic code to find folders/files. Isn't it correct?</p>
  
  <p>Questions is, in the above perl script, how do I search for files/folders recursively?</p>
  
  <p>Second questions, I found that <code>perldoc &lt;module&gt; help</code> does not have examples about using a certain function in that module, which would make it clear. </p>
  
  <p>Can you point to some good help/document/book for using various perl functions from different perl modules with clear examples of usage of those module functions.</p>