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