#! /usr/bin/perl BEGIN{ push @INC, ( 'lib'); my @filenameparts = split( /\\/, __FILE__ ); my $destination_dir; $destination_dir .= "$filenameparts[$_]/" for ( 0 .. $#filenameparts - 1 ); chop $destination_dir; chdir $destination_dir; } use Tk; use Tk::Varname; my $hauptfenster = new MainWindow( -title => "Plavedo"); my $entry = $hauptfenster->Varname::Entry(-textvariable => \$irgendwas, -varname => "MIAU")->pack(); my $button_neu=$hauptfenster->Button(-text => "Neu", -command => [\&neuer_eintrag])->pack(); MainLoop(); sub neuer_eintrag{ my $info = $entry->cget(-varname); print $info; }