Hi, thanks for your reply. I don't think I made myself clear: the loops in the example code I posted are not there for any purpose other than for the Perl script to do something while the message window is displayed. In the real code, there would be a Perl 'system' call to a scanner program, requiring user interaction, at that point. Therefore there is no loop in the real code.
I must confess that, even if I had a loop in the real code, I wouldn't feel comfortable with putting in a forced "refresh" every time round it: surely there's a less crude way of not losing the contents of a window?