- or download this
my %count = ();
foreach my $device (@current_list, @temp_devicelist) {
$count{$device}++;
}
- or download this
my %count;
# ...
...
my @difference = grep { $count{$_} == 1 } keys %count;
my @intersect = grep { $count{$_} == 2 } keys %count;
my @union = keys %count;
- or download this
print "Difference:\n";
print "$_\n" for @difference;
...
print "$_\n" for @intersect;
print "Union:\n";
print "$_\n" for @union;