#!/usr/local/bin/perl -w use strict; use Tk; my $haupt = new MainWindow; my $links = $haupt->Frame(); $links->Label(-text=> "Geben Sie die Namen der Ausgangsdatei und der Ausgabedatei ein: ")->pack(); my $ausgangsdatei = $links->Entry(); $ausgangsdatei->pack(); my $ausgabedatei = $links->Entry(); $ausgabedatei->pack(); my $schalter1 = $links->Button( -text=>"START", -command=> \&action )->pack(); my $schalter2 = $links->Button( -text=> "Exit", -command => [$haupt => 'destroy'] )->pack; my $rechts = $haupt->Frame(); $rechts->Label(-text=> "Ausgabe:")->pack(); my $daten = $rechts->Listbox(); $links->pack(-side => "left"); $rechts -> pack(-side => "right"); MainLoop(); sub action { open(DATEI,"<$ausgangsdatei") or die "Datei kann nicht ge\x94ffnet werden"; open(NEU, ">$ausgabedatei") or die "Datei kann nicht ge\x94ffnet werden"; undef$/; my $text = ; print "\n\n$text\n"; $text =~s/\bsie\b/Sie/g; print NEU $text; print "\n\n$text\n"; close(DATEI); close(NEU); }