Keep It Simple, Stupid | |
PerlMonks |
Re^2: Interrupting a loopby etj (Curate) |
on Jul 28, 2024 at 13:43 UTC ( [id://11160789]=note: print w/replies, xml ) | Need Help?? |
To emphasise a point in choroba's excellent thought: when you want to juggle multiple events (a signal/button-click AND elapsed time), you need to stay in the idiom of the relevant event loop. In Tk, that's why you'd want to do the time-delay with Tk::after, not with sleep, so the event loop can quietly also watch for the button-click etc and react; sleep just suspends the whole process until the OS sends it a SIGALRM.
In Section
Seekers of Perl Wisdom
|
|