wook has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Encode::Unicode; use Tk; $mw = new MainWindow(-title=>"Keyword Tidy"); $mw->withdraw(); $frame1 = $mw->Frame()->pack(-side=>top); $text = $frame1->Scrolled("Text", -scrollbars=>'e', -width=>45, height +=>20, -font=>"Arial 10 normal")->pack(-side=>top, -padx=>7, -pady=>7) +; $frame2 = $mw->Frame()->pack(-side=>top); $label = $frame2->Label(-text=>"Remove:", -font=>"Arial 10 bold")->pac +k(-side=>left, -padx=>7, -pady=>7); $entry = $frame2->Entry(-width=>20)->pack(-side=>left, -padx=>2, -pady +=>7); $button = $frame2->Button(-text=>"Tidy Up", -command=>\&doit)->pack(-s +ide=>right, -padx=>10, -pady=>7, -ipadx=>10, -ipady=>7); $mw->deiconify(); MainLoop(); sub doit { $words = $text->get("1.0", "end"); $text->delete("1.0", "end"); $toremove = $entry->get(); @w = split(/\n/, $words); foreach $i (@w) { $i =~ s/\s+$//; $i =~ s/^\s+//; $i =~ s/$toremove//g; } $done = join("\n", @w); $text->insert("end", $done); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/Tk exe not working
by rinceWind (Monsignor) on Oct 10, 2005 at 15:48 UTC | |
by Anonymous Monk on Oct 10, 2005 at 16:06 UTC | |
by rinceWind (Monsignor) on Oct 10, 2005 at 16:14 UTC | |
by wook (Novice) on Oct 10, 2005 at 16:25 UTC | |
by Anonymous Monk on Oct 10, 2005 at 16:23 UTC | |
by rinceWind (Monsignor) on Oct 10, 2005 at 16:38 UTC | |
|
Re: Perl/Tk exe not working
by gri6507 (Deacon) on Oct 10, 2005 at 15:37 UTC | |
by Anonymous Monk on Oct 10, 2005 at 15:43 UTC |