In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/7da9d78d2f2bc1bac6dbce17590ae3a20a24a6cc?hp=e94880707b4983968cb376474e3570790e71c109>

- Log -----------------------------------------------------------------
commit 7da9d78d2f2bc1bac6dbce17590ae3a20a24a6cc
Author: Ævar Arnfjörð Bjarmason <[email protected]>
Date:   Fri Jul 15 21:26:31 2016 +0000

    gv.c: Add a comment about what powers Foo->import|unimport
    
    This comments some ancient code added by Larry back in
    perl-5.000-ga0d0e21, I was searching for what made this not error:
    
        $ ./miniperl -we 'package Foo {} Foo->import'
    
    Commenting out this "if" clause will make that error the same way that
    this would:
    
        $ ./miniperl -we 'package Foo {} Foo->whatever
        Can't locate object method "whatever" via package "Foo" at -e line 1.
-----------------------------------------------------------------------

Summary of changes:
 gv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gv.c b/gv.c
index 4d5a071..46eb079 100644
--- a/gv.c
+++ b/gv.c
@@ -1061,6 +1061,9 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char 
*name, const STRLEN le
 
     gv = gv_fetchmeth_pvn(stash, name, nend - name, 0, flags);
     if (!gv) {
+       /* This is the special case that exempts Foo->import and
+          Foo->unimport from being an error even if there's no
+         import/unimport subroutine */
        if (strEQ(name,"import") || strEQ(name,"unimport"))
            gv = MUTABLE_GV(&PL_sv_yes);
        else if (autoload)

--
Perl5 Master Repository

Reply via email to