haoess has asked for the wisdom of the Perl Monks concerning the following question:
perlsub says:
if an "AUTOLOAD" subroutine is defined in the package or packages used to locate the original subroutine, then that "AUTOLOAD" subroutine is called with the arguments that would have been passed to the original subroutine.
package Foo; sub AUTOLOAD { __PACKAGE__ } package main; sub AUTOLOAD { __PACKAGE__ } # should print Foo print $Foo::foo->(); # main print Foo::foo(); # Foo
Does $Foo::foo->() not mean locate the sub in the package Foo?
-- Frank
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Autoloading and anonymous subs
by Joost (Canon) on Jun 27, 2007 at 18:06 UTC | |
by ysth (Canon) on Jun 28, 2007 at 05:07 UTC | |
Re: Autoloading and anonymous subs
by shmem (Chancellor) on Jun 27, 2007 at 16:53 UTC | |
by rir (Vicar) on Jun 28, 2007 at 21:04 UTC | |
by shmem (Chancellor) on Jun 28, 2007 at 21:07 UTC | |
by haoess (Curate) on Jun 27, 2007 at 22:58 UTC | |
by shmem (Chancellor) on Jun 27, 2007 at 23:12 UTC |
Back to
Seekers of Perl Wisdom