my %sl; @sl{@sl} = (); my @ar2 = grep {!exists $sl{$_}} @ar1; print Dumper \@ar2;