...
my @stack = $self->{stack};
($self->{stacktraces}{join('->',@{$self->{stack}})} = \@stack )
&& ...
which treats $self->{stack} as an array, not a reference. I think you meant to write this:
...
my @stack = @{ $self->{stack} };
($self->{stacktraces}{ join('->', @{$self->{stack}}) } = \@stack)
&& ...
Incidentally, while looking at the code I found it useful to add another method to the CallStackAnalyzer package:
sub print {
use Data::Dump;
my $self = shift;
dd $self;
}
and to call it in sub Main:
...
$CSA->TraceFile(\@tracecontent);
$CSA->print;
...
Hope that helps,
|