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; } #### #... grep_line => sub { my($test, $ra) = @_; grep { $_ eq $t and return 1 } @$ra; return; }, for_line => sub { my($test, $ra) = @_; $test eq $_ and return 1 foreach @$ra return; } #...