in reply to Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34.
I understand your question as the desire to use the same AUTOLOAD in different files/packages.
And I presume you already tried the obvious - importing - and it failed.
> *AUTOLOAD = \&BASE_CLASS::AUTOLOAD; #this doesn't seem to work
one guess: did you put this in a BEGIN {} block?
untested since you didn't provide an SSCCE to reproduce it and the concept really looks like *a terrible hack*...
A more terrible hack would be to do
BEGIN { eval <<"__CODE__"; sub AUTOLOAD { $BODY_OF_ORIG_AUTOLOAD } __CODE__ }
like this the AUTOLAD could be indistiguishible from a real autoload
or
BEGIN { require "The_Autoload.pl"; }
with
sub AUTOLOAD { ... # Body of Autoload }
inside.
again untested for mentioned reasons
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|