in reply to Perl Tk--Delay

Based on how you described the problem, I'm not sure you've shown us enough code to identify the cause. Either that, or else I don't understand what your problem is.

Is it the case that your "cont()" sub is supposed to be called in response to some user input event (a button click or such)? If so, then the "if($answerbactch...)" condition is supposed to be in a callback routine, to be triggered by the user's input (e.g. as the "-command" parameter for some button widget).

Maybe instead of passing a reference to the sub for the "-command" parameter, you're actually executing the sub when declaring the widget? I really am just guessing here about parts of your code that you have not shown us, but a lot of Tk users tend to get tripped up on this sort of problem.