#!/usr/bin/perl use Tk; use strict; use warnings; my (@status_label, @status_value); my ($entry11, $entry12, $entry21, $entry22); #--- my $mainwindow = MainWindow->new(); $mainwindow -> title('testtk'); my $frame_top = $mainwindow ->Frame() ->pack(-side=>'top'); my $label1 = $frame_top ->Label( -textvariable => \$status_label[0] ) ->grid(-row=>1,-column=>1); my $label2 = $frame_top ->Label( -textvariable => \$entry12 ) ->grid(-row=>1,-column=>2); my $value1 = $frame_top ->Label( -textvariable => \$entry21 ) ->grid(-row=>2,-column=>1); my $value2 = $frame_top ->Label( -textvariable => \$entry22 ) ->grid(-row=>2,-column=>2); #--- @status_label = ("abc","def"); @status_value = (1,2); &update_interface(); MainLoop; #--- sub update_interface { $entry11 = $status_label[0]; $entry12 = $status_label[1]; $entry21 = $status_value[0]; $entry22 = $status_value[1]; }