Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 28 lines (22 sloc) 0.693 kb
5b5f3d0 @jhannah This program is listed as a one-liner in matching.html. One-liners are h...
authored
1 #!/usr/bin/perl
2
3 # This program is listed as a one-liner in matching.html. One-liners are hard to debug,
4 # though, so I'm pulling it out into a normal program. --jhannah 20100311
5
c9ffaf3 @jhannah I broke a long one-liner in matching.html into it's own perl program (di...
authored
6 use strict;
7
8 my (@data, @olddata, $dist);
5b5f3d0 @jhannah This program is listed as a one-liner in matching.html. One-liners are h...
authored
9 while (<>) {
10 @data = split;
11 if ($data[3] eq "-") {
12 if ($data[1] ne $olddata[1]) {
13 if (@olddata) {
14 print "@olddata[0..5] 1000 $data[6]\n";
15 }
16 print "@data[0..5] 1000 $data[6]\n"
17 } else {
18 print "@olddata[0..5] $dist $data[6]\n@data[0..5] $dist $data[6]\n";
19 }
c9ffaf3 @jhannah I broke a long one-liner in matching.html into it's own perl program (di...
authored
20 } else {
21 $dist = @olddata ? $data[2] - $olddata[2] : 1000;
5b5f3d0 @jhannah This program is listed as a one-liner in matching.html. One-liners are h...
authored
22 }
23 @olddata = @data;
24 }
c9ffaf3 @jhannah I broke a long one-liner in matching.html into it's own perl program (di...
authored
25 print "@olddata[0..5] 1000 $data[6]\n";
5b5f3d0 @jhannah This program is listed as a one-liner in matching.html. One-liners are h...
authored
26
27
Something went wrong with that request. Please try again.