#!/usr/local/bin/perl
# $ARGV[0]:  one
# $ARGV[1]:  two
# prints the union of one and two (all in one and all in two without repeats)
# first prints everything in one, then all the things in two that are not in one
open(one,$ARGV[0]);
while ($oneline = <one>) {
	print $oneline;
    }
close(one);
open(one,$ARGV[1]);
while ($oneline = <one>) {
    $found = 0;
    open(two,$ARGV[0]);
    while (($twoline = <two>) && !$found) {
	if ($oneline eq $twoline) {
	    $found = 1;
	    last;
	}
    }
    close(two);
    if ($found == 0) {
	print $oneline;
    }
}
close(one);

