foreach my $thing (@array) { if(exists $hash{$thing}) { push @new_array, $hash{$thing}; } }