perl -E "$h = {a=>1, b=>2, c=>3, d=>4}; @k = qw(b d); say for $h->@{@k};" 2 4