There is no need for a prototype which also means you don't need to forgo the OO if you don't want to.
sub int_monitor:lvalue { my $var=\shift; print "$var\n"; $$var };
Very neat! I guess that relies on two facts: that @_ contains aliases to the args (which I knew but had forgotten) and that shift returns the first element of the array, rather than a copy of it.
Thanks for your suggestions,
Markus
In reply to Re^3: Returning a tied scalar
by MarkusLaker
in thread Returning a tied scalar
by MarkusLaker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |