Subject: | Does not set the namespace of the field accessors |
Some packages such as Class::Tie::InsideOut and Class::C3 require that
the caller() information from accessors match the actual packages they
are in. Class::Fields doesn't set this.
Attached is a patch to fix that.
Note that an alternative way to do this is to use Sub::Name, but that
requires an additional dependency (and a compiler). The patch uses a
pure-Perl version.
No tests for this are attached, though.
Subject: | Class-Field.diff |
diff -r Class-Field-0.12/lib/Class/Field.pm Class-Field-0.12.orig/lib/Class/Field.pm
7,8c7
< our $VERSION = '0.12_01';
< $VERSION = eval $VERSION;
---
> our $VERSION = '0.12';
13c12
< "sub {\n local \*__ANON__ = \"%s::%s\";\n",
---
> "sub {\n",
56c55
< my $code = sprintf $code{sub_start}, $package, $field;
---
> my $code = $code{sub_start};