#!C:/Perl/bin/perl.exe use warnings; use strict; use Win32::SerialPort; my $response; my $port = Win32::SerialPort->new("COM1"); $port->user_msg(1); $port->error_msg(1); $port->baudrate(9600); $port->databits(8); $port->parity("none"); $port->stopbits(1); $port->handshake("xoff"); $port->buffers(8192, 8192); $port->are_match(":", ">", ">>", "\n"); $port->write_settings; $response = $port->input; print "DEBUG: response1 = $response\n"; $port->write("InReach\r"); sleep 1; $response = $port->input; print "DEBUG: response2 = $response\n"; $port->write("********\r"); sleep 1; $response = $port->input; print "DEBUG: response3 = $response\n"; $port->write("exit\r"); sleep 1; $response = $port->input; print "DEBUG: response4 = $response\n";