cat file1 file2 | perl -ne 'print if !(defined($foo{$_})); $foo{$_} = 1;' > out_file