http://www.perlmonks.org?node_id=58015

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have created a GUI program from Perl/Tk but it freezes whenever there's no data coming from the socket. I would like the program to maintain user interactiviy while the program listens for data from the socket. Here's part of my code.
build_gui(); ## sets up the gui_interface exit; sub build_gui { ## sets up a button and other widget)} ## invoked when user pressed a button sub event_handler { $handle = IO::Socket::INET->new("$host:$port"); while (<$handle>) # my program freezes here as it # waits for data in the socket { ## do stuff and then updates the GUI interface } }
Thanks in advance for the help.

Originally posted as a Categorized Question.