develooper Front page | perl.perl5.porters | Postings from March 2015

Re: Setting PL_savebegin ( done by Devel::Cover ) breaks scopedestruction

Thread Previous | Thread Next
From:
Paul Johnson
Date:
March 17, 2015 21:52
Subject:
Re: Setting PL_savebegin ( done by Devel::Cover ) breaks scopedestruction
Message ID:
20150317215238.GI11223@pjcj.net
On Sun, Feb 22, 2015 at 03:35:38PM +1300, Kent Fredric wrote:
> After much analysis, I've discovered an unfortunate problem.

[ PL_savebegin can affect order of destruction ]

Is that inherent in what PL_savebegin does, or a bug?

I wonder whether anything else uses PL_savebegin?

For Devel::Cover, it's not that I really want the functionality it is
bringing (who does?) but that I want to be able to get at the optree of
the BEGIN before it is deleted and PL_savebegin provides a way to do
that by not deleting the optree when it normally would be deleted.

What I would prefer would be a hook of some description that gets called
immediately before an optree gets deleted.  This could also solve the
problem of not being able to capture the code coverage for statements in
modules outside of subroutines.

That's all very handwavey, but is it at all feasible?

Or is there a better solution?

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About