Help for this page
my @kansas = qw( corn wheat hay cattle ); my @oklahoma = qw( wheat dairy cattle ); ... my %hash = map{ $_=>1} @{$_[1]}; return grep { !defined $hash{$_} } @{$_[0]}; }
Benchmark: timing 100000 iterations of diff1, diff2... diff1: 2 wallclock secs ( 1.74 usr + 0.01 sys = 1.75 CPU) diff2: 3 wallclock secs ( 2.22 usr + 0.01 sys = 2.23 CPU)