Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^10: Use of inherited AUTOLOAD for non-method is no longer allowed with Perl 5.34.

by LanX (Saint)
on Sep 29, 2021 at 18:18 UTC ( [id://11137124]=note: print w/replies, xml ) Need Help??


in reply to Re^9: 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.

> and eval a set of

no eval needed with no strict 'refs';

use strict; use warnings; package FP; sub AUTOLOAD { our $AUTOLOAD; print "hello $AUTOLOAD\n" } my @pkgs =qw/BLA BLUB MyHomepage::Introduction/; for my $PKG (@pkgs) { no strict 'refs'; *{ "${PKG}::AUTOLOAD" } = \&FP::AUTOLOAD } BLA::bla(); MyHomepage::Introduction::intro();

hello BLA::bla hello MyHomepage::Introduction::intro

But I already suggested Importing in my first reply ...

update
BTW: typo
*${packagename)::AUTOLOAD = \&FP::AUTOLOAD; ^

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137124]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-25 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found