Using File::Find::Rule to get the list of files in Perl -


i trying identify list of .cpp files in repository. using following script:

use file::find::rule; use strict; use warnings;  @files = file::find::rule->name('*.cpp'); print dumper @files; 

i following output:

$var1 = bless( {              'mindepth' => undef,              'maxdepth' => undef,              'extras' => {},              'subs' => {},              'iterator' => [],              'rules' => [                           {                             'args' => [                                         '*.cpp'                                       ],                             'rule' => 'name',                             'code' => 'm{(?-xism:^(?=[^\\.])[^/]*\\.cpp$)}'                           }                         ]            }, 'file::find::rule' ); 

i not find references online fetching list of files.

can please point me how required list?

thanks.

one way:

my @files = file::find::rule->file()->name('*.cpp')->in('.'); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -