in reply to Tk failure
I assume that you do have use TK; somewhere in the rest of the script. So just add MainLoop; before the final closing curly brace.