tie is overkill. Use Variable::Magic.
use Variable::Magic qw( wizard cast ); my $wiz = wizard( set => sub { print "Now set to ${$_[0]}.\n" }, ); cast my $name, $wiz;
In reply to Re: call subroutine if scalar is changed
by ikegami
in thread call subroutine if scalar is changed
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |