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
Post a Comment