3 # Written by Marc Espie, 2001.
12 open(SORTED, shift) or die "No sorted output\n";
15 while (m/^tsort: cycle in data/) {
19 last if m/^tsort: cycle in data/;
20 last unless m/^tsort:\s+/;
24 $exception{$list[$i-1].' '.$list[$i % @list]} = 1;
34 open(PAIRS, shift) or die "No pairs\n";
37 push(@pairs, split(/\s+/, $_));
41 if (defined $exception{"$a $b"}) {
44 next if $break{$a} = 1;
45 next unless $order{$a} < $order{$b};
46 die "Bad pair $a $b\n";
51 while (($key, $v) = each %exception) {
53 die "Bogus cycle edge $key\n" unless $ok{$key};