in reply to Re: Read file line by line and check equal lines
in thread Read file line by line and check equal lines

Why the sub call with a leading ampersand (&unique)? Since perl 5 that form is no longer necessary and has the side-effect of using (and exposing)the caller's @_ instead of building its own. You are not using @_ at all, so it's unnecessary.

Instead, your sub uses two global variavles, one lexical ($previous) and the package variable $_. That should be avoided except in very special cases. In this case it is hard to see why you use a sub at all. Just expand the code in the loop body. That would be clearer.

Anno