I'm working on a script where I create a little server with IO::Socket. It accepts a string from the client side which I split into two, a user and a pass. While debugging and writing these two fields to a logfile, I noticed that if I chomped the $pass variable (at the end of the string initially), I get a ^M at the end but if I don't, the carriage return remains. I am deliberating whether or not to use chop which does remove the ^M but don't want to do so if this is a random event.