in reply to Detect variable change?

Look at Tie::Scalar.