my $coderef = $foo->can( 'bar' ); my $class = Sub::Information->new( $coderef )->package();