in reply to Re^2: Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34.
in thread Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34.

> but i have to modify all such instances for the same

same with  *AUTOLOAD = \&BASE_CLASS::AUTOLOAD;

(shrug) !

I know many dirty workarounds° in Perl but I doubt what you want is possible or even desirable.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) well as always with Perl ... provided the base class is directly used one could try a source filter to inject sub AUTOLOAD in the importing file. But I wanna be damned before showing how...

Replies are listed 'Best First'.
Re^4: Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34.
by LanX (Saint) on Sep 27, 2021 at 17:07 UTC
    FWIW: an even less stable hack would be to write something like an 'INIT {}' or 'CHECK{ }' block to indentify all defined packages/classes after compilation which inherit from the BASE_CLASS:: ( see ->isa in UNIVERSAL )

    all those packages could then have a new AUTOLOAD added via eval.

    this will not work in all cases because those timing issues in Perl are highly flexible:

    • a sub could have been called before compilation finished.
    • a class could be defined dynamically afterwards at runtime
    • ...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery