This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix a remaining B::Lint bug.
[perl5.git] / ext / B / B / Lint.pm
index cb15b79..9a977c8 100644 (file)
@@ -250,6 +250,11 @@ sub B::SVOP::lint {
            if ($gv->NAME =~ /^_./ && $gv->STASH->NAME ne $curstash) {
                warning('Illegal reference to private name %s', $gv->NAME);
            }
+       } elsif ($opname eq "method_named") {
+           my $method = $op->gv->PV;
+           if ($method =~ /^_./) {
+               warning("Illegal reference to private method name $method");
+           }
        }
     }
     if ($check{undefined_subs}) {