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(). / .