in reply to Unresponsive Perl Tk GUI when using system() calls

I read in a few places that to make the Perl Tk GUI responsive when a system() call is made to open a file, that it required threads.

You are like the Sourcerer's Apprentice, :-) Threads by themselves don't magically make system calls non-blocking. You need to read deeper, and see that the system call needs to be run in a thread. This is called "blocking the Tk eventloop". See the Tk Event Loop

You might run your non-blocking code like this simple thread example. See, your system call is in the thread.

That is about as simple as I can explain it, of course, real code is usually a bit more complicated.

#!/usr/bin/perl use warnings; use strict; use threads; my $thr = threads->new(\&sub1); print "thread running now\n"; $thr->join(); # wait for trivial thread to finish # and return sub sub1{ system("documentation.doc"); print "Done in thread\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh