#! /usr/bin/perl use strict; use warnings; use diagnostics; use Tk; my $mw = MainWindow->new(); my $liste = $mw->ScrlListbox(-label => "Liste",                                           -selectmode => "extended",           -height => 6,           -exportselection => 0)->pack(); my $startButton = $mw -> Button(-text => "start", -command => \&write_file)->pack(); &fill_list(); MainLoop; sub fill_list{  my $file = '/Pfad/zur/Datei.txt';  open(DATEI,"<$file") or die $!;  while(my $line = ){    chomp $line;    $liste->insert("end",$line);  }  close DATEI; } sub write_file{  my $file = '/Pfad/zur/Zieldatei.txt';  my @sel_items = $liste->Getselected();  open(WRITE,">$file") or die $!;  for(@sel_items){    print WRITE $_,"\n";  }  close WRITE; }