This should do it:
my @array = qw(a b c) ;my %hash = ( a => 1 , b => 2 ) ;my @result = grep { exists $hash{$_} } @array ;