sum1.pl 260 Bytes
Newer Older
Loïc Barrault's avatar
Loïc Barrault committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/local/bin/perl -w 

$compression = shift(@ARGV); 
$document = shift(@ARGV); 

$counter = 0; 

open(DOC,$document); 
while ($line = <DOC>) { 
    chop $line; 
    ++$counter; 
    if ($counter <= $compression) { 
	print "$line\n"; 
    }
}

close(DOC);