in reply to Perl/Tk while {1} and a responsive UI

If your actions are small enough, you could try to do the trick I used in a simpleminded modular synthesizer: replace your MainLoop with something like:

while (1) { DoOneEvent(DONT_WAIT); # do your own (short) action select undef,undef,undef,0.0001; }

It's not perfect, but if your code can be broken up like this, it's pretty easy to implement.