djcp3 has asked for the wisdom of the Perl Monks concerning the following question:

I want to alias a package name. According to documents I found, the following code should work. Instead of working I get Undefined subroutine &__ANON__::test1 called at ptest10 line 16.
package Test3; sub test1 { print "hello\n"; } 1; package main; *Test2:: = \*Test3:: ; $INC{"Test2.pm"}++; Test2::test1(); 1;

Replies are listed 'Best First'.
Re: Alias of a package not working
by choroba (Cardinal) on Aug 14, 2016 at 23:40 UTC
Re: Alias of a package not working
by kevbot (Vicar) on Aug 14, 2016 at 23:39 UTC