in reply to Comparing each element of Array A to Array B

You can use hashes:

my @arr1 = qw/1 3 4 5 6/; my @arr2 = qw/1 2 4 5 7 10/; my %hash2; @hash2{@arr2} = ("1") x @arr2; for (sort {$a <=> $b} @arr1){ print "$_\n" if (! defined $hash2{$_}); }

Prints:

3 6

citromatik

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.