use strict; use Tk; use File::Copy; sub KopierTest; sub Ausgabe; my $Zahl = 0; my $QuellFile = "C:\\test.txt"; my $ZielFile = "C:\\test1.txt"; my $MainWindow = MainWindow->new; $MainWindow->title("test"); my $StartButton = $MainWindow->Button ( -text => "starte den Test", -command => sub { KopierTest; } ) ->pack ( -fill=>'both', -padx=>10, -pady=>10, ); $MainWindow->repeat(100, \&Ausgabe); MainLoop; sub KopierTest { copy ($QuellFile, $ZielFile); } sub Ausgabe { print "Hallo, ich bin der TEST Nummer $Zahl\n"; $Zahl++; }