in reply to Autoloading and anonymous subs

$Foo::foo->() calls the subroutine reference in $Foo::foo. (i.e, $foo in the Foo package). Assuming $Foo::foo is undefined and you're not running under strict, that would probably refer to the subroutine "" in the calling package (I'm guessing here, since I tend not to run strict-less)

If you want to call Foo::foo() as a class method of Foo, do:

Foo->foo();

Replies are listed 'Best First'.
Re^2: Autoloading and anonymous subs
by ysth (Canon) on Jun 28, 2007 at 05:07 UTC
    sub AUTOLOAD {"AUTOLOAD"} *{""} = sub {"empty"}; print $nosuch->();
    confirms your suspicion.