package main; no strict 'refs'; *Foo::bar = sub { return __PACKAGE__ }; print Foo::bar(); # prints 'main'