in reply to Re: User Feedback for Subroutines with Long Execution Time
in thread User Feedback for Subroutines with Long Execution Time
For those not familiar with graphical interfaces, this is often called a "callback". In any case, one must assume that your long running process has a way of knowing how far along it is, and you'll have to have various points in the process explicitly call the callback with the current status report.
sub statusPrint { # code to update status print shift; } sub longprocess { my &status = shift; #do stuff &status("10%"); #more stuff &status("20%"); } call it with: longprocess (\&statusPrint);
In Section
Seekers of Perl Wisdom