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.
In reply to Re: Searching for two lines that begin with the same string
by ikegami
in thread Searching for two lines that begin with the same string
by tgrossner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |