All can I say is that perldoc -f tie and the other docs are quite clear. I used to be scared by tie() myself, but in the end it results not to be that difficult... quite curiously I had a tie-related problem too this week (although it turned out not to be strictly tie specific).
Whatever, to answer your second question: it all depends on the class that implements your variable!
In particular, you use yourself the verb "to pass" rather than "to assign". And indeed assigning anything, including a reference, to a tied variable is not different than passing that "anything" to a suitable method. HTH.
| [reply] [d/l] [select] |
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. | [reply] |
You will find an explanation in perltie.
If you pass a reference to a tied scalar, the reference to the tied scalar, uh, gets passed. Your question doesn’t make much sense.
Makeshifts last the longest.
| [reply] |
Anything assigned to a tied scalar (reference or otherwise) results in the associated STORE method being called. What a particular STORE method does with a reference is up to that particular STORE method.
Documentation: perltie
| [reply] |