#!/usr/bin/perl -w use strict; use Tk; my $haupt = new MainWindow; my $links= $haupt->Frame(); $links->Label(-text => "Ausgangsdatei:")->pack(); my $ausgang = $links->Entry(); $ausgang->pack(); $links->Label(-text => "Ausgabedatei:")->pack(); my $ausgabe = $links->Entry(); $ausgabe->pack(); my $schalter = $links->Button(-text => "Einlesen", -command => \&einlesen )->pack(); my $schalter2 = $links->Button(-text => "Beenden", -command=>[$haupt => 'destroy'] )->pack(-pady => "20"); my $rechts= $haupt ->Frame(); $rechts->Label(-text =>"Ihr Ergebnis")->pack(); my $daten = $rechts ->Listbox(); $daten->pack(); $links ->pack (-side =>"left"); $rechts ->pack(-side =>"right"); MainLoop(); sub einlesen { my $quelle = $ausgang ->get; my $ergebnis = 0; $ergebnis = $quelle; $daten->insert('end', " ". $ergebnis ); }