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

Re: Setting PL_savebegin ( done by Devel::Cover ) breaks scope destruction

Thread Previous
From:
Father Chrysostomos
Date:
March 18, 2015 00:57
Subject:
Re: Setting PL_savebegin ( done by Devel::Cover ) breaks scope destruction
Message ID:
20150318005724.2432.qmail@lists-nntp.develooper.com
Paul Johnson wrote:
> What I would prefer would be a hook of some description that gets called
> immediately before an optree gets deleted.

There is an op-freeing hook, that I believe is undocumented.
File::Glob uses it.  Look for PL_opfreehook in ext/File-Glob/Glob.xs.
I am not sure how you would determine whether you are looking at the
root.  Perhaps checking the type of the op would be sufficient.

You might also consider attaching 'free' magic to every CV.  But I am
not sure exactly where you would attach it.  A keyword plugin that
checks whether PL_compcv has magic already and then declines to
parse the current keyword would work most of the time, but fail for
Acme::EyeDrops code.  A PL_check hook that hooks every op type, or
maybe just nextstate, may work better.


Thread Previous


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