Hi. I am using a sub with my Tk module similar to;
sub tick { # Run every 1000 milliseconds. if ($toggle_scan_v eq 0) {return}; # Break out of this tick l +oop # Do something $kount++; print "$kount "; $mw->after(1000, \&tick); # Suggest loop here print "No Error; we should get here often. \n"; }
I trust that whenever the "after" is executed, the print is executed, after which a graceful exit of the subroutine occurs. This provides dead time for the thread of execution. In turn other events belonging to this same thread may occur and execute (possibly turning $toggle_scan_v on and stopping this "tick" loop which is earmarked to execute 1000 mSec after the "after" method).
I trust that the subroutine is called and always subsequently returns in such a manner that there is no stack littering.?
Regards JC....
In reply to Tk module usage of after method by jmClifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |