grep { exists($hash{$_}) && do_something($_) .. 1 } @options or log_failure();