Hi all,
I am trying to compare two arrays in perl using the following code.
foreach $item (@arrayA){
push(@arrayC, $item) unless grep(/$item/, @arrayB);
}
The above code stores in arrayC all the elements of arrayA that do not belong in arrayB. The problem is the following.
If for example @arrayA[3]=1121 and @arrayB[13]=11213456
The above code will return that 1121 of arrayA exists in arrayB. This is not correct. How can i overcome this?
Best regards,
Christos