# statement is prepared in advance, and values are bound right after that $mw->Busy; $tk_col->delete(0, 'end'); $sth->execute(); # this blocks for several minutes; $mw->Unbusy; while (my $row = $sth->fetchrow_arrayref) { $tk_col->insert('end', $row); } #### POE::Session->Create ( inline_states => { _start => \&execute_query(); # calls $kernel->yield('result') when done result => \&populate_result(); # fills Tk Widget _stop => sub { $MW->update() }; }, args => [ $sth ], ); POE::Kernel->run();