How to bind each variable in a perl script?

I want to see every place when a variable is created in perl script / accessed / destroy

Easy to reach with tieorVariable::Magic

But how to apply this magic automatically when creating a variable?

+5
source share
1 answer

You can take a look at B :: Xref, which generates a cross-reference list of all the variables in your application. Basically, you need to go through the byte code to find all variable declarations / initializations. You can also change the byte code, i.e. Add code to bind variables. However, I cannot give you an example, because this is rarely done.

tie(). / .

+1

Source: https://habr.com/ru/post/1015683/


All Articles