summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2023-02-02 15:15:04 +1100
committerTony Cook <tony@develop-help.com>2023-02-08 13:42:50 +1100
commit626df4fd56759528a170e821cab27f372b174496 (patch)
treea8712418609e1d7a24f54d47cb4514e475037c36 /pp_ctl.c
parent0de69e372d3baf843522c30d8711b6513c2a472b (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 4ffd59bbbe..193e328088 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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";