#! /local/bin/perl
#
# rnew		--- extract new & changed records from old & new versions
#
# Oscar Nierstrasz -- 15/11/93
#
# Revised and simplified: 29/11/93
# Re-written: 2/12/93
#
# The following would be equivalent to: comm -13 $old $new
# (after accounting for records vs. lines), except comm has
# a built-in limit of 256 chars per line!

($old,$new) = @ARGV;

open(OLD,$old) || die "Can't open $old\n";
open(NEW,$new) || die "Can't open $new\n";

$/ = "";

@old = sort(<OLD>);
@new = sort(<NEW>);

$index = shift(@old);

foreach $item (@new) {
	while ($item gt $index) { $index = shift(@old); }
	if ($item lt $index) { print $item; }
	# else skip this item
}

