in reply to Are two lines in the text file equal
How about this (untested):
open LOG, '<', 'somelog' or die $!; my %tracker; my $line; while ($line = <LOG>) { push @{ $tracker{$line} }, $.; } close LOG; for my $key (keys %tracker) { print "Lines ", join(', ', @{$tracker{$key}}), " are the same.\n" if (@{ $tracker{$key} } > 1); }
|
|---|