in reply to Text strangeness after using SMB to get a file
On Windows, line-endings are two characters: \r\n. On Unix line-endings are a single character: \n. When you run your script on Solaris, chomp removes a trailing \n, but leaves the (now trailing) \r (carriage return).
So, when you print "LINE:$mem<\n", the last character in $mem is a carriage return, which moves the cursor back to the lefthand edge of the screen on the same line before printing the "<" and then the newline that you explicitly asked for.
This may have been obvious to you after reading Paladin's response, but this trips me up occassionally too and typing this helps me to remember...
|
|---|