Skip to content

Commit f661536

Browse files
maukeoalders
authored andcommitted
fix regex anchors in PPI::Statement::Compound->type
1 parent e225a34 commit f661536

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/PPI/Statement/Compound.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ sub type {
119119
if ( $content =~ /^for(?:each)?\z/ ) {
120120
$Element = $self->schild(++$p) or return $content;
121121
if ( $Element->isa('PPI::Token') ) {
122-
return 'foreach' if $Element->content =~ /^my|our|state\z/;
122+
return 'foreach' if $Element->content =~ /^(?:my|our|state)\z/;
123123
return 'foreach' if $Element->isa('PPI::Token::Symbol');
124124
return 'foreach' if $Element->isa('PPI::Token::QuoteLike::Words');
125125
}

0 commit comments

Comments
 (0)