diff options
author | Tony Cook <tony@develop-help.com> | 2023-02-02 15:15:04 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2023-02-08 13:42:50 +1100 |
commit | 626df4fd56759528a170e821cab27f372b174496 (patch) | |
tree | a8712418609e1d7a24f54d47cb4514e475037c36 /pp_ctl.c | |
parent | 0de69e372d3baf843522c30d8711b6513c2a472b (diff) | |
download | perl-626df4fd56759528a170e821cab27f372b174496.tar.gz |
allow AUTOLOAD for the INC method of objects in @INC
This matches the behaviour in 5.36.
This does not allow AUTOLOAD for INCDIR, since if there is an AUTOLOAD
the check for INC would have already succeeded.
Fixes #20665
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4338,10 +4338,11 @@ S_require_file(pTHX_ SV *sv) * call the method. */ HV *pkg = SvSTASH(SvRV(loader)); - GV * gv = gv_fetchmethod_pvn_flags(pkg, "INC", 3, 0); + GV * gv = gv_fetchmethod_pvn_flags(pkg, "INC", 3, GV_AUTOLOAD); if (gv && isGV(gv)) { method = "INC"; } else { + /* no point to autoload here, it would have been found above */ gv = gv_fetchmethod_pvn_flags(pkg, "INCDIR", 6, 0); if (gv && isGV(gv)) { method = "INCDIR"; |