title: Using File::Find::Rule to get the list of files in Perl
body: <p>I am trying to identify the list of all .cpp files in my repository. I am using the following script:</p>
  
  <pre><code>use File::Find::Rule;
  use strict;
  use warnings;
  
  my @files = File::Find::Rule-&gt;name('*.cpp');
  print Dumper @files;
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>$VAR1 = bless( {
               'mindepth' =&gt; undef,
               'maxdepth' =&gt; undef,
               'extras' =&gt; {},
               'subs' =&gt; {},
               'iterator' =&gt; [],
               'rules' =&gt; [
                            {
                              'args' =&gt; [
                                          '*.cpp'
                                        ],
                              'rule' =&gt; 'name',
                              'code' =&gt; 'm{(?-xism:^(?=[^\\.])[^/]*\\.cpp$)}'
                            }
                          ]
             }, 'File::Find::Rule' );
  </code></pre>
  
  <p>I could not find any references online about fetching the list of files.</p>
  
  <p>Can someone please point me to how to get the required list?</p>
  
  <p>Thanks.</p>