sub array_union { my ($arrRef1, $arrRef2) = @_; my %hash; @hash{@$arrRef1} = undef; @hash{@$arrRef2} = undef; return keys %hash; }