$_ % 2 and $has_odd = 0 and last; #### $_ % 2 or $has_even = 1, last; #### $has_even = 1, last unless $_ % 2;