#!/usr/bin/perl -w # http://www.cyut.edu.tw/~ckhung/b/pl/ use strict; use Tk; my ($main, $e, $b); $main = MainWindow->new(-title=>"Demo"); $e = $main->Entry(); $b = $main->Button(-command=>\&update); $e->pack(-expand=>"yes", -fill=>"both"); $b->pack(-expand=>"yes", -fill=>"both"); MainLoop(); sub update { my ($t) = $e->get(); $b->configure(-text=>$t); }