计算工程中总共有多少行代码

use strict;
use File::Find;
print "input your dir here: \n"; 
chomp(my $dir = <STDIN>);
print "counting,please waiting...\n"; 
find(\&wanted,$dir);

my $line_count;
sub wanted{
	if(-f $_){
	   my $file = $_;
	   open(FILE,"<",$file) or die "Can't open $file $!\n";
	   $line_count++ while(<FILE>);
	   close(FILE);
	}
}

print "Alother $line_count lines in $dir \n"; 
system("pause");
计算工程中总共有多少行代码_第1张图片

你可能感兴趣的:(计算工程中总共有多少行代码)