1 #遍历一个文件夹 2 3 use File::Find; 4 5 my $path = '/home/test/'; 6 sub process 7 { 8 if ( -f $File::Find::name ) 9 { 10 if ( $File::Find::name =~ /\.old$/ ) 11 { 12 print "$File::Find::name\n"; 13 } 14 } 15 } 16 17 find( \&process, $path );
转载于:https://www.cnblogs.com/sssmmmxxx/archive/2012/11/13/2768469.html