Is there any way to recalculate a certain variable when another variable's
value changes? For instance if,
$a = 5;
$b = $a * 4;
$a = 10;
At the end of that, $a will be 10, but $b will still be 20 (5 * 4). Is
there any way, short of manually recalculating $b every time $a might
change, to have $b set to 40 when $a is set to 10? I know I could just do
something like:
print $a * 4, "\n";
instead of
print "$b\n";
But with a large set of variables like this that are used quite often, this
method is rather slow and error-prone.
I've tried to do this with references, but I've had no luck.
Thanks,
-Michael Kelly
Email: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]