You know I'm picky about terminology, calling my "private" and package vars "public" would have been better.
I'm not an expert on the theory and terminology, I'm an engineer and I care more about how things work ;-)
Solutions are available by parsing the optree like demonstrated in B::Xref B::Concise and B::Deparse
Yes, I was thinking about these too, it's too bad none of them provide exactly what you want already. B::Xref seems like a decent starting point, unless of course someone has done this already (I don't know yet).