tie would affect performance of the script, especially if you tie every variable in it. Plus, there is no way to automatically tie every variable either. The problem is lexicals; you can't override my to coerce it into calling the tie constructor. So you'll have to manually tie every variable you're interested in. If you're interested in every variable, tie them all. But expect that to be a drag on the script's performance. The performance hit comes from the fact that variable access will now have all this extra work attached to it. You can't escape that.
One strategy is to use a debug flag. If the script is invoked with the -tie flag (for example), your code would go ahead and tie every variable that you set up to do so. And if the script isn't invoked with the -tie flag, your script would skip the code that ties the variables you need to watch. That's just a matter of you coming up with the proper logic to make that happen.
Is it possible that your problem has some other solution? What exactly are you really trying to do, that is requiring you to watch every single variable in the script?
Dave
In reply to Re^3: Knowing when variables change?
by davido
in thread Knowing when variables change?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |