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.
Comment on Re^4: Perl - TK - Listbox insertion problem
No, you do not understand. The insert method inserts a string into a widget, but it returns an empty string (see return). You can use or die only on functions that return something on succes and undef (emtpy string, zero) on failure. insert does not behave this way, therefore, it cannot be used in or die construction.