http://qs321.pair.com?node_id=1079646


in reply to Re^2: compare 2 arrays for intersect diff and commmon values
in thread compare 2 arrays for intersect diff and commmon values

Where you have our $device=$current_list[$n][0] the device name is now in $device, so that is what you want to count. Right after that add the line $count{$device}++;. Then do the same for where you have our $tempdevicelinks=$temp_list[$n][0] - add the line $count{$tempdevicelinks}++;. You could just copy and paste my sections of code into the relevant parts of your own code, and delete from your own code this bit:
foreach my $device (@current_list, @temp_devicelist) { $count{$device}++; }