commit 8908cc9b15a67bf8180c42af06d37f476e493e54
parent 8139713c46aa63abb65d53fc237a21ffe91aa0bb
Author: rsc <rsc>
Date: Fri, 10 Aug 2007 17:45:14 +0000
correct line numbers
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/runoff1 b/runoff1
@@ -13,12 +13,15 @@ if($ARGV[0] eq "-n") {
}
$n = int(($n+49)/50)*50 - 1;
+$file = $ARGV[0];
@lines = <>;
+$linenum = 0;
foreach (@lines) {
+ $linenum++;
chomp;
s/\s+$//;
if(length() >= 75){
- print "$ARGV[0]:$.: line too long";
+ print STDERR "$file:$linenum: line too long\n";
}
}
@outlines = ();