while(<$new_sock>) { my $input = chomp $_; #print $_; $canvas->update_graph( $input ) # pseudocode to demo point :-) $mw->update; # force the event loop to auto update the window } #### my $timer = $mw->repeat(10, \&update_graph);