in reply to Sort and Compare Files

Why are you opening FILE and then reading from either STDIN or the files in @ARGV using the semi-magical <> construct?

Reading from <FILE> would probably work better...

(I didn't scan it for less glaring mistakes, though I would suggest that you do as perlstyle suggests and include the file name and operation in your error messages along with $!.)