> (untested, till someone provides a real SSCCE)

here we go to prove my theory

this works (in a wider sense ;):

use strict; use warnings; # https://perlmonks.org/?node_id=11137026 package Base; use Data::Dumper; sub AUTOLOAD { our $AUTOLOAD; warn "$AUTOLOAD => ", Dumper \@_; } #*UNIVERSAL::AUTOLOAD = \&AUTOLOAD; package Bla; *AUTOLOAD = \&Base::AUTOLOAD; # aka Bla::AUTOLOAD some_sub(1,2,3); *Foo::AUTOLOAD = \&Base::AUTOLOAD; Foo::some_sub(4,5,6)

-*- mode: compilation; default-directory: "d:/tmp/pm/" -*- Compilation started at Wed Sep 29 12:33:29 C:/Strawberry/perl/bin\perl.exe -w d:/tmp/pm/universal_autoload.pl Name "Foo::AUTOLOAD" used only once: possible typo at d:/tmp/pm/univer +sal_autoload.pl line 25. Name "Bla::AUTOLOAD" used only once: possible typo at d:/tmp/pm/univer +sal_autoload.pl line 19. Bla::some_sub => $VAR1 = [ 1, 2, 3 ]; Foo::some_sub => $VAR1 = [ 4, 5, 6 ]; Compilation finished at Wed Sep 29 12:33:29

this horribly fails (please note also all those potential problems caused by UNIVERSAL::AUTOLOAD by triggering with intentionally undefined methods)

use strict; use warnings; # https://perlmonks.org/?node_id=11137026 package Base; use Data::Dumper; sub AUTOLOAD { our $AUTOLOAD; return if $AUTOLOAD =~ /::DESTROY$/; # ignore destruction * warn "$AUTOLOAD => ", Dumper \@_; } *UNIVERSAL::AUTOLOAD = \&AUTOLOAD; package Bla; *AUTOLOAD = \&Base::AUTOLOAD; # aka Bla::AUTOLOAD some_sub(1,2,3); #*Foo::AUTOLOAD = \&Base::AUTOLOAD; Foo::some_sub(4,5,6)

-*- mode: compilation; default-directory: "d:/tmp/pm/" -*- Compilation started at Wed Sep 29 12:37:45 C:/Strawberry/perl/bin\perl.exe -w d:/tmp/pm/universal_autoload.pl Name "UNIVERSAL::AUTOLOAD" used only once: possible typo at d:/tmp/pm/ +universal_autoload.pl line 15. Name "Bla::AUTOLOAD" used only once: possible typo at d:/tmp/pm/univer +sal_autoload.pl line 20. Bla::some_sub => $VAR1 = [ 1, 2, 3 ]; Use of inherited AUTOLOAD for non-method Foo::some_sub() is no longer +allowed at d:/tmp/pm/universal_autoload.pl line 28. Compilation exited abnormally with code 255 at Wed Sep 29 12:37:45

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

update

*) added, otherwise the output is littered with all objects with undefined DESTROY methods triggering AUTOLOAD.


In reply to Re^9: Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34. (SSCCE) by LanX
in thread Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.