The output record separator for print() and cmd() is set to "\n" by default, so that you don't have to append all your commands with a newline. To avoid printing a trailing "\n" use put() or set the output_record_separator to "". #### In the input stream, each sequence of carriage return and line feed (i.e. "\015\012" or CR LF) is converted to "\n". In the output stream, each occurrence of "\n" is converted to a sequence of CR LF. See binmode() to change the behavior. TCP protocols typically use the ASCII sequence, carriage return and line feed to designate a newline.