#!/usr/bin/perl use strict; use warnings; use utf8; use Tk; my $hallo = "Hallöchen"; my $fenster = MainWindow->new(); my $eingabe = $fenster->Entry()->pack(); my $schalter = $fenster->Button(-text => $hallo, -command =>\&loeschen)->pack(); sub loeschen { my $text = $eingabe -> get; print $text . "\n"; } MainLoop();