http://paperlined.org/dev/src/pl/git_characterize_files/count_text_files.pl
#!/usr/bin/perl
# count how many text-files and non-text-files are there
use strict;
use warnings;
use Data::Dumper;
#use Devel::Comments; # uncomment this during development to enable the ### debugging statements
my @text;
my @nontext;
chdir "target";
open my $pin, '-|', 'find', '.', '-type', 'f' or die $!;
while (<$pin>) {
chomp;
next if (grep {$_ eq '.git'} split '/');
if (-T $_) {
#s#^\.\/target\/##;
push(@text, $_);
} else {
#s#^\.\/target\/##;
push(@nontext, $_);
}
}
print " Num textfiles: ", scalar(@text), "\n";
print "Num non-textfiles: ", scalar(@nontext), "\n";
print "\n";
print "======================= non-text files ========================\n";
foreach my $nontext (@nontext) {
#print "$nontext\n";
system "ls", "-l", $nontext;
#print "\n", join("\n", @nontext), "\n";
}
Generated by GNU enscript 1.6.4.