http://www.perlmonks.org?node_id=797399


in reply to Re: current/active package
in thread current/active package

Except,
sub woot { my ($self) = @_; print __PACKAGE__, "\n"; # <-- prints "foo" print ref($self), "\n"; # <-- prints nothing }
While,
sub woot { my ($self) = @_; print __PACKAGE__, "\n"; # <-- prints "foo" print $self, "\n"; # <-- prints "bar" }
I think this is because, in this simple example, the object was never blessed. Had it been blessed, I think ikegami's answer is correct.