in reply to Re^2: how watch a variable
in thread how watch a variable

What you showed is essentially what Tie::Watch (among other modules) does, and tie is built-in

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery