I have two arrays:
@Array1 which contains A,B,C,D,E
and
@Array2 which contains L,B,C,F,E
I tried using a foreach to go through every element in the arrays and say if it’s true or not to get started but I get dirty big fat errors when doing anything.
The program works perfectly with one foreach, but with a nested one it bugs out:
foreach my $var (@Array1){
print "Letter $var";
foreach my $var2 (@Array2){
if($var2 eq $var) {
print "They are equal";
} else {
next;
}
}
}
Any Ideas; one error is:
Use of uninitialized value in string eq at compare.pl line 192, <> line 2.
I’ve run it:
and I’ve got it