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
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;