in reply to Problem with logging binary data through serial port
You can also try
$ob->stty_icrnl(1) || die "failed setting convert cr to new line"; [download]