Switch from perl function to gtimeout for auto-kill feature