Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello
Giving a script as simple as this
use strict; use warnings; use utf8; use Tk; my $mw = tkinit(); my $name = 'bound to entry'; my $label = $mw->Label( -text => 'Enter:', )->grid( -row => 0, -column => 0, ); my $entry = $mw->Entry( -textvariable => \$name )->grid( -row => 0, -column => 1, ); my $button = $mw->Button( -text => 'Clear', -command => sub{ $name = ''; }, )->grid( -row => 2, -column => 0, -columnspan => 2, ); $mw->MainLoop();
how can a call a subroutine if $name is programmatically changed? (In this case by clicking of the button, but in my real case it is changed from a third party component.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: call subroutine if scalar is changed
by haj (Vicar) on Jun 08, 2019 at 12:22 UTC | |
|
Re: call subroutine if scalar is changed
by haukex (Archbishop) on Jun 08, 2019 at 12:26 UTC | |
by Anonymous Monk on Jun 08, 2019 at 13:26 UTC | |
by choroba (Cardinal) on Jun 08, 2019 at 14:51 UTC | |
by haukex (Archbishop) on Jun 08, 2019 at 20:23 UTC | |
|
Re: call subroutine if scalar is changed
by ikegami (Patriarch) on Jun 08, 2019 at 23:56 UTC | |
by stevieb (Canon) on Jun 09, 2019 at 00:09 UTC | |
by LanX (Saint) on Jul 26, 2019 at 23:44 UTC | |
by ikegami (Patriarch) on Jul 29, 2019 at 03:22 UTC | |
|
Re: call subroutine if scalar is changed
by choroba (Cardinal) on Jun 08, 2019 at 12:25 UTC |