use base 'Class::MOP::Method';
+use constant _PRINT_SOURCE => $ENV{MOP_PRINT_SOURCE} ? 1 : 0;
+
## accessors
sub new {
my $e = do {
local $@;
local $SIG{__DIE__};
- $code = eval join
+ my $source = join
"\n", (
map {
/^([\@\%\$])/
} keys %$__captures
),
$_[2];
+ print STDERR $_[0]->name, ' ', $source, "\n" if _PRINT_SOURCE;
+ $code = eval $source;
$@;
};