#!/usr/bin/perl use Tk; use strict; use warnings; my $main = MainWindow->new; my $entry = $main->Entry( -text => 'bla' ) -> pack(); $main->Button( -text => 'leer', -command => sub { $entry->configure( -text => '' ); } ) -> pack(); $main->Button( -text => 'nicht leer', -command => sub { $entry->configure( -text => 'nicht leer' ); } ) -> pack(); MainLoop;