If you can live without OO, using lvalue subrutines with (\$) prototypes makes things cleaner:
sub int_monitor (\$ ) :lvalue { my $var=shift; print "$var\n"; $$var };
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 };
In reply to Re^2: Returning a tied scalar
by nobull
in thread Returning a tied scalar
by MarkusLaker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |