Easiest thing would be to fork a child off to do the stuff that you want to do while the rest of the program is just waiting for user input.. if you need to have it update things in the Tk window I believe you could use Tk::Receive and send to complete this.