http://qs321.pair.com?node_id=1104706

glenn has asked for the wisdom of the Perl Monks concerning the following question:

How to get TK widget option to accept variable reference? I need to use this in more than one place and it's not an option to store the button in the hashref as this hashref will be updated by other clients.

use Tk; $mw = MainWindow->new(); my $system = {}; $system->{blink}->[0] = "disabled"; #works but does not update as value in hashref changes my $but = $mw->Button(-text=>"Blink Unit", -state=>$system->{blink}->[ +0])->pack(); #does not work as state will not accept variable reference #my $but = $mw->Button(-text=>"Blink Unit", -state=>\$system->{blink}- +>[0])->pack(); =pod *$but->{'Configure'}->{'-state'} = \$system->{blink}->[0]; #overwrite +the location of the value?? =cut