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

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

Thread Previous | Thread Next
Paul Johnson
March 17, 2015 21:52
Re: Setting PL_savebegin ( done by Devel::Cover ) breaks scopedestruction
Message ID:
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 -

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About