Skip to content

Commit 66bce47

Browse files
committed
prevent possible regex on undefined scalar in __current_token_is_forced_word
1 parent f776efa commit 66bce47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/PPI/Tokenizer.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ sub __current_token_is_forced_word {
833833
# We also have to make sure that the sub/package/etc doing the forcing
834834
# is not a method call.
835835
if( $USUALLY_FORCES{$content}) {
836-
return if $word =~ /^v[0-9]+$/ and ( $content eq "use" or $content eq "no" );
836+
return if defined $word and $word =~ /^v[0-9]+$/ and ( $content eq "use" or $content eq "no" );
837837
return 1 if not $prevprev;
838838
return 1 if not $USUALLY_FORCES{$prevprev->content} and $prevprev->content ne '->';
839839
return;

0 commit comments

Comments
 (0)