sartak/autobox-Closure-Attributes — pull request #1 by scrottie (2013-04-21 06:03:33+00:00)
Title: Delegate off to methods declared in the same package as the coderef

From the commit:

{ package Foo; sub gen { my $x; sub { $x * 2; }; sub inc_x { $_[0]->x++ } } my $foo = Foo::gen; $foo->inc_x;
Uses B to inspect the coderef to get the package name it was created in.
This mechanism has priority over finding variables with PadWalker::closed_over().