in reply to Re^2: call subroutine if scalar is changed
in thread call subroutine if scalar is changed

You're changing the value before the main loop has been entered. Modify the final paragraph to
$mw->after(1000, sub { print "name is $name\n"; $name = "bar"; print "name is $name\n"; }); MainLoop;
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]