% perl -ne '$p ne$_&&print;$p=$_' ...
In reply to Re^4: to avoid redundacy in a file by tadman in thread to avoid redundacy in a file by Anonymous Monk