I'm curious how Moo and Moose play together.

I have some classes that make use of
Throwable::Error<http://search.cpan.org/dist/Throwable/lib/Throwable/Error.pm>,
which uses the StackTrace::Auto role.   The problem is StackTrace::Auto
builds Devel::StackTrace without the "no_refs" option set, so my objects
leak.  (They don't get DEMOLISHED until global destruction.)

My quick fix was to add this wrapper to my Throwable::Error subclass to add
the no_refs argument to Devel::StackTrace:

around _build_stack_trace_args => sub {
    my ( $orig, $self, @rest ) =  @_;
    my $args_array = $self->$orig( @rest );
    push @{$args_array}, no_refs => 1;
    return $args_array;
};


This worked fine until I updated Throwable::Error which now uses Moo
instead of Moose.

Am I correct that "around" just will not work any more?

Do I have any other options other than overriding the entire
_build_stack_trace_method (besides trying to get no_refs added to the
Throwable dist)?

Thanks,



-- 
Bill Moseley
[email protected]

Reply via email to