while (<>) { chomp; next if defined($last) && $_ eq $last; $last = $_; print; }
On the other hand, if you're trying to remove duplicates, the answer is in perlfaq4.
In reply to Re: How to group identical words?
by ikegami
in thread How to group identical words?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |