AUTOLOAD methods on objects in @INC are not called by perl 5.37.7.
I'm not sure what the best behavior here is, but I see two possible solutions. First is to not change anything and just document that AUTOLOAD is ignored for this case. Second is checking for an AUTOLOAD method after checking for INC, INCDIR, and string overloads, and if it exists calling it for INC.
Steps to Reproduce
perl -E'package AutoHook { sub DESTROY {} sub AUTOLOAD { say our $AUTOLOAD; return; } } unshift @INC, bless {}, "AutoHook"; require strict;'
On perl 5.36.0 this produces:
On perl 5.37.7 this produces no output.
AUTOLOADmethods on objects in@INCare not called by perl 5.37.7.I'm not sure what the best behavior here is, but I see two possible solutions. First is to not change anything and just document that
AUTOLOADis ignored for this case. Second is checking for anAUTOLOADmethod after checking forINC,INCDIR, and string overloads, and if it exists calling it forINC.Steps to Reproduce
On perl 5.36.0 this produces:
On perl 5.37.7 this produces no output.