my @a = qw (a d c d s f ss eef e as d); GREP: { grep{ $_ eq 'd' and next GREP } @a; print 'not match'; last GREP; } continue { print 'match'; last GREP; }