#!/usr/bin/perl
use strict;
use warnings;
my @unique = ();
my %seen = ();
foreach my $elem (@originalarray) {
next if $seen{$elem}++;
push @unique, $elem;
}
my ( @union, @intersection, @difference );
my %count;
my $element;
@union = @intersection = @difference = ();
%count = ();
foreach $element ( @originalarray, @unique ) { $count{$element}++ }
foreach $element ( keys %count ) {
push @union, $element;
push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element;
}
while ( ( my $key, my $value ) = each(%count) ) {
print "", ( $value - 2 ) . " " . $key if ( $value >= 3 );
}
####
Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268500
Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268500
Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268500
Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245700
Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245700
Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66:34200
Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66:34200
Lesle Kerstin:408-456-1234:4 Harvard Square, Boston, MA 02133:4/22/62:52600
JonDeLoach:408-253-3122:123 Park St., San Jose, CA 94086:7/25/53:85100
####
1 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245700
2 Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268500
1 Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66:34200