in reply to Perl/TK Error

Doing a little experimentation, it seems as though that error is occuring because $sock isn't a valid filehandle to print to. Make sure $sock is what you think it is.

Could you tell us more about $sock and where it comes from (ex/ what's the open call look like)?