#/usr/bin/perl -w use strict; use Tk; my $window_hash = {}; $window_hash->{main}->{main} = new MainWindow(); $window_hash->{main}->{children} = {}; $window_hash->{main}->{children}->{frame} = $window_hash->{main}{main}->Frame()->grid(-column, 0, -row, 0, -sticky, 'news'); $window_hash->{main}->{globals}->{test1} = "hi"; $window_hash->{main}->{globals}->{test2} = "there"; $window_hash->{left_label} = $window_hash->{main}->{children}->{frame}->Label(-textvariable, $window_hash->{main}->{globals}->{test1})->pack(-side, 'left'); $window_hash->{right_label} = $window_hash->{main}->{children}->{frame}->Label(-textvariable, $window_hash->{main}->{globals}->{test2})->pack(-side, 'right'); $window_hash->{test_button} = $window_hash->{main}->{children}->{frame}->Button(-command, \&_usr_next())->pack(-side, 'bottom'); MainLoop; sub _usr_next { $window_hash->{left_label}->configure(-textvariable, $window_hash->{main}->{globals}->{test2}); $window_hash->{right_label}->configure(-textvariable, $window_hash->{main}->{globals}->{test1}); }