Debian Codegraph @

tcl/ex/red-pd/PIdent/PIdent.pl

raw
1 #!/usr/bin/perl -w
2
3 use strict 'refs';
4 use strict 'subs';
5
6 if ($#ARGV < 0) {
7 &usage;
8 exit;
9 }
10
11 sub usage {
12 print STDERR " usage: $0 <filepattern> \n";
13 exit;
14 }
15
16 my @a = <$ARGV[0]*>;
17
18 foreach $file (@a) {
19
20 my ($pre, $pre2, $suffix) = split(/-/,$file);
21
22 print STDERR "Doing $file \n";
23
24 my $command = "grep \'3:5-\' $file | awk \'{if (\$1==\"3:5-identified\") idCount++; count++} END {print $suffix, idCount/count, idCount, count}\'";
25
26 system($command);
27
28 }
29