in reply to tied scalars
If you have tied scalar variable, it is similar to have an instance of object with some methods, described in perltie. And when you attempts to change the value of the tied scalar variable, perl invokes the method STORE with the new value as argument. So, the real action depends on STORE's body, in other words, on the class used when variable tied.