Assuming you don't want to write the three lines which compare the present value to some old value, you could use:
while(<DATA>) { chomp; print "pleasure - $_\n" if ($_ ne $old) && ($old = $_); } __DATA__ apples apples apples oranges pears bread bread
--
Steve Marvell
In reply to Re: At each change in...
by marvell
in thread At each change in...
by malaga
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |