in reply to call subroutine if scalar is changed
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: call subroutine if scalar is changed
by stevieb (Canon) on Jun 09, 2019 at 00:09 UTC | |
|
Re^2: call subroutine if scalar is changed
by LanX (Saint) on Jul 26, 2019 at 23:44 UTC | |
by ikegami (Patriarch) on Jul 29, 2019 at 03:22 UTC |