$port = '/dev/ttyS0'; $ob = Device::SerialPort->new ($port); $ob->user_msg(1); # misc. warnings $ob->error_msg(1); # hardware and data errors $ob->baudrate(19200); $ob->parity("none"); $ob->databits(8); $ob->stopbits(1); $ob->handshake('none'); $ob->stty_icrnl(1) || die "failed setting convert cr to new line"; $ob->read_interval(0) if ($OS_win); $ob->read_const_time(10000); #$ob->read_const_time(500); # 500 milliseconds = 0.5 seconds $ob->read_char_time(1); # avg time between read char $ob->write_settings || die "no settings";