my %first = map { $_ => 1 } @arr2; @result = grep !exists $first{$_}, @arr1;