foreach my $ts ( @{$test} ) { foreach my $sc (@{$source} ) { if ( $ts ne $sc ) # <- You will fail here { print "FALSE\n";