in reply to Searching for two lines that begin with the same string

Do you care about order? If not, use a hash.
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.