Since I want to develop a script to find all of these variables automatically, I'll need PadWalker just to find them. However, once I've gotten their names, and given that the reference to them seems to be incorrect, I need some other way to determine how much memory they're using. So, it comes down to this question - If I know the name of a Perl module, and I know the name of a "my" variable at file level in that module, how do I determine how much memory it's using?
The test code I presented was mainly to show a problem that I saw in PadWalker. However, to create a truely automated script, I can't count on having a function like get_mem() in each module. I've thought about writing a generic get_mem()-like function and adding it to packages automatically, but in that case, it would not know about specific variables in each package. All suggestions gratefully accepted!
In reply to Re^10: Finding file level lexical variables
by johndeighan
in thread Finding file level lexical variables
by johndeighan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |