PilotinControl has asked for the wisdom of the Perl Monks concerning the following question:
Good Evening Monks. I would like to post multiple rows using the following code however only one line is posted when selected any suggestions? Thanks in advance.
#!/usr/bin/perl use Tk; my $window = MainWindow->new; $window->title("Host Report"); ($labs = $window->Label(-text => "Results"))->pack(-side => 'bottom'); $window->Entry(-textvariable => \$hdb )->pack; $window->Button(-text => "Go", -command => \&host )->pack; $window->Button(-text => "Quit", -command => \&stop )->pack; MainLoop; sub host { open (FH,"hostdata.txt"); my @lines = <FH>; close FH; foreach my $hdb2 (@lines) { my @field = split(':',$hdb2); if ($field[0] =~ /(?<![\w-])$hdb(?![\w-])/i) { $labs->configure(-text =>"$field[0] $field[1] $field[2]"); } } } sub stop{ exit; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiple Rows
by mtmcc (Hermit) on Oct 04, 2013 at 07:10 UTC | |
by PilotinControl (Pilgrim) on Oct 04, 2013 at 13:39 UTC | |
by PilotinControl (Pilgrim) on Oct 04, 2013 at 18:15 UTC | |
by mtmcc (Hermit) on Oct 04, 2013 at 20:16 UTC | |
by PilotinControl (Pilgrim) on Oct 05, 2013 at 21:04 UTC | |
by mtmcc (Hermit) on Oct 05, 2013 at 21:31 UTC | |
Re: Multiple Rows
by aaron_baugher (Curate) on Oct 04, 2013 at 04:34 UTC | |
Re: Multiple Rows in Tk::Label
by Anonymous Monk on Oct 04, 2013 at 04:31 UTC |
Back to
Seekers of Perl Wisdom