Perl遍歷查找文件
使用Perl查找當前目錄下的所有PDF文件
#!/usr/bin/perl -w
use strict;
use warnings;
use File::Find;
my $local_file = "./";
sub wanted {
my $findfile = $File::Find::name;
if ( $findfile =~ /\.pdf$/ ) {
print("$findfile\n");
}
}
find(\&wanted, $local_file);