in reply to Re: Extracting elements in one array but not in another
in thread Extracting elements in one array but not in another
and I got the following output with no warnings:#! /usr/bin/perl -w use strict; my @a = (1,2,3,4,5); my @b = (2,4,6,8); my %c; @c{@a} = undef; my @bb = grep { ! exists $c{$_} } @b; my %d; @d{@b} = undef; my @aa = grep { ! exists $d{$_} } @a; print "@aa\n"; print "@bb\n";
If I add an undef to @a or @b in my example, I get the warnings you describe.1 3 5 6 8
|
|---|