I understand the produces an empty string but this is not the case when i am using end it is producing a string. Its producing the first response from the server and inserting it into my listbox its not until after that does the program end and give the error. When i remove the or die it does not even do this. It wont even insert the first response from the server it does nothing. So this is why this problem is a weird one to me.