# Script Schedule.pl use Tk; use Win32::Process; use Tk::Schedule; my ($EntryMan, $TL, $Process); my $Command = "C:\\Perl\\bin\\perl.exe"; my $Inherit = 0; my $Dir = "."; my $mw = MainWindow->new; $mw->title("MainWindow"); $mw->Entry(-selectbackground=>'white',-selectforeground=>'black',-textvariable=>\$EntryMan)->pack(); $mw->Button(-text=>"Schedule",-command=>\&doTopLevel)->pack(); MainLoop; sub doTopLevel { if(!Exists($TL)) { $TL=$mw->Toplevel(); $TL->title("Schedule-Modul"); $TL->Schedule( -interval => 30, -repeat => "once", -command =>[\&getProcess, $EntryMan], -comment => "Do an activity")->pack(); } else { $TL->deiconify(); $TL->raise(); } } sub getProcess { my ($EntryTest) = shift; my $MyArg = "perl test.pl -a $EntryTest"; Win32::Process::Create($Process, $Command, $MyArg, $Inherit, NORMAL_PRIORITY_CLASS, $Dir) or die Win32::FormatMessage(Win32::GetLastError()); }