my @big = qw(a b c d e f g h i); my @kw= qw(f c d g); my %small = map {$_=>undef} @kw; exists $small{$_} or push @kw,$_ for @big; # or, Alternatively, # push @kw,grep {!exists$small{$_}} @big; print qq(@kw\n); -- Output -- f c d g a b e h i