What is the best way to receive data from a socket in Perl, when the data length is unknown? -


Now, I read a letter in a loop at a time, as long as I \ 0 What is a better way of doing this?

Set the line \ x {00} (\ 0), make sure to make it local, and getline on handle, like:

  {local $ / "" xx {00} "; While (my $ line = $ sock-> is found) {Print "$ line \ n"; # Whatever happens with your data here}}  

Comments