in reply to Re^3: Perl - TK - Listbox insertion problem
in thread Perl - TK - Listbox insertion problem

I added the or die to the working code and it still worked just fine. It inserted into the list box over and over and never ended the program. So no i do not know what your talking about sense it worked.
  • Comment on Re^4: Perl - TK - Listbox insertion problem

Replies are listed 'Best First'.
Re^5: Perl - TK - Listbox insertion problem
by choroba (Cardinal) on Apr 27, 2010 at 12:54 UTC
    Really? Can you post the code? The following code does not work for me, I have to remove or die as shown in the commented line to make it work:
    use strict; use warnings; use Tk; use Tk::Listbox; my $top = MainWindow->new; my $f = $top->Frame->pack; my $lb = $f->Listbox()->pack; open my $STDIN,'-'; $top->fileevent($STDIN, readable => sub { chomp(my $line = <>); # # $lb->insert('end',$line); # $lb->insert('end',$line) or die; }); MainLoop;