Skip to content

@INC hooks ignore AUTOLOAD #20665

Description

@haarg

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:

AutoHook::INC

On perl 5.37.7 this produces no output.

Activity

  1. added a commit that references this issue on Feb 2, 2023
    abb62ce
  2. added a commit that references this issue on Feb 8, 2023
    626df4f
  3. added 2 commits that reference this issue on May 20, 2023
    40cdcce
    689bce9
  4. added a commit that references this issue on Jul 10, 2023
    b363913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions