in reply to Re^2: print a determinate line number
in thread print a determinate line number

ah i see it now ;) ... something like this then.
use strict; use warnings; my $previous_line; while(<DATA>){ chomp; if($.==1){ $previous_line = $_; next; } if($_ eq $previous_line){ print "Line $. : $_\n"; } $previous_line = $_; } __DATA__ a b b c c c d
UPDATE:

Sorry the code above prints the duplicated lines, which is the opposite of what you wanted. i see that almut already has an elegant solution for you.

Replies are listed 'Best First'.
Re^4: print a determinate line number
by Paulux (Acolyte) on Oct 06, 2009 at 13:53 UTC
    Thanx a lot, i have just added some control but it works.