in reply to Searching for two lines that begin with the same string
my %data; while (<>) { my $net = (split ' ')[0]; push @{$data{$net}}, $_; } foreach my $group (values %data) { if (@$group > 1) { print @$group; } }
Update: Tested. Added missing if.
|
|---|