in reply to Progress Bar controlled via Perl
merlyn has written an article on it, which is usually referenced when these sorts of questions come up:
Watching long processes through CGI