in reply to Help with string concat and sockets

Jen--one quick idea I had is that perhaps your data has control-M characters in it, which screw up the presentation when you try to look at it in the print statement. I've seen such characters make lines look pretty strange, in the past.

To test this, you could try join-ing on a carriage return ("\n"), just to see if this is indeed the problem. If your data looks right, this could be it. In which case you'll want to strip control-M characters:

tr/\cM//d;