ganeshk has asked for the wisdom of the Perl Monks concerning the following question:
or$session{x} = 1;
or$y = $session{x}; # $session{x} is an object $y->set_z(3); # this changes the state of object $y
I would like it, if this can be automated instead of manually going through the code for all methods. What I was trying was to go through all links from the application UI so that all methods will be executed. I injected some debugging code which will compare the serialized version of the hash before and after the execution of the methods. If there was a difference the method name will be logged. But then the code is bound to change in future and so would require repetition of above process. It would be better if there was any automatic way like a script that would inspect the code(also "use" the modules if needed) and find the list. To me this looked quite challenging! But I think there will be really smart minds to crack this.$y = $session{x}; foo($y); sub foo { $y->set_z(3); # this changes state of object $y }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find whether code can change a module variable
by kyle (Abbot) on Oct 25, 2007 at 20:59 UTC | |
|
Re: Find whether code can change a module variable
by TGI (Parson) on Oct 25, 2007 at 22:52 UTC | |
|
Re: Find whether code can change a module variable
by ganeshk (Monk) on Oct 30, 2007 at 02:49 UTC |