What is it that you want to write to the text widget?
If it's something simple, a return code from the child process might suffice. Are you writing all of the ssh output to that widget?
If it's not just a simple return value, it sounds like IPC (something like
IPC::ShareLite) might be what you need. (I've never used it, but it seems pretty straightforward from what I've seen on the POD).
Update: Misread part of your post, edited my response accordingly.