http://qs1969.pair.com?node_id=765543


in reply to Re: Flip-flop won't DWIM
in thread Flip-flop won't DWIM

So use the match-once operator (no need for an actual pattern; the empty pattern works fine):
print join ' ', grep scalar(??../D/), ('A'..'F');

Caution: Contents may have been coded under pressure.