Unbuffering your output $| =1; may make this more time sensitive.
-monkfish (The Fishy Monk)
In reply to Re: Detect Stop Button by monkfish in thread Detect Stop Button by hakkr