@result = grep { exists $h{$_} } @a[$k .. $l]; say join ', ', @result;