in reply to Devel::Cover eating caller() information

It isn't just that $@ is getting blown away, is it? Maybe change
eval { throw TestCaller }; isa_ok($@, 'TestCaller'); is_deeply($@->...
to
eval { throw TestCaller }; my $error = $@; isa_ok($error, 'TestCaller'); is_deeply($error->...
And see if that makes any difference at all? Just a thought. Still, you ideally wouldn't want Devel::Cover to alter your program in any way.
------------ :Wq Not an editor command: Wq

Replies are listed 'Best First'.
Re^2: Devel::Cover eating caller() information
by stvn (Monsignor) on Sep 10, 2004 at 21:11 UTC
    It isn't just that $@ is getting blown away, is it?

    No, I have tried that in the code that this issue originally showed up in. But now I have discovered something even weirder. When I changed this:

    push @stack_trace, [ (caller($i))[0 .. 3] ] while caller(++$i);
    to this (taken straight from Devel::StackTrace):
    while ( do { package DB; @DB::args = (); @c = caller($i++) } ) { push @stack_trace, [ @c[0 .. 3] ]; }
    (Note the post-increment of $i instead of the pre-increment)

    This makes the Devel::Cover run work, and the plain test fail. So it seems that maybe Devel::Cover is pushing up the caller level?

    Oh well, still looking.

    -stvn