in reply to Input of a Data Stream

You can read from your socket as you would a normal filehandle. You could use read to read from it as well. Filehandle-type reads are easier, but if you're looking for a specific end of message sequence, you're better off going with read.

See perlipc for more details.