Thread perl-ausgabe bearbeiten
(5 answers)
Opened by Tenuo at 2012-05-04 15:38
Auf der Konsole ist sowas relativ umständlich (Term::ReadLine, Term::ReadKey wurde ja schon genannt).
Es ist eher typisch für Eingaben in grafischen Oberflächen, z.B.: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #!/usr/bin/perl use warnings; use strict; use Tk; my $text = ""; my $mw = new MainWindow; my $entry = $mw->Entry(); $entry->insert('end', "Dies ist ein Text."); $entry->focus(); $entry->pack(-padx=>20,-pady=>20); my $button = $mw->Button(-text=>"Ok",-command=>sub{$text=$entry->get();$mw->destroy()}); $button->pack(-padx=>20,-pady=>20); MainLoop; print "Text ist: $text\n"; Last edited: 2012-05-04 16:19:01 +0200 (CEST) |