Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Devel::Cover eating caller() information

by etcshadow (Priest)
on Sep 10, 2004 at 20:38 UTC ( #390182=note: print w/replies, xml ) Need Help??

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($@->...
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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://390182]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2019-09-23 13:04 GMT
Find Nodes?
    Voting Booth?
    The room is dark, and your next move is ...

    Results (279 votes). Check out past polls.