#! C:\perl\bin\perl.exe use strict; use warnings; use Win32::SerialPort; my $port_name = 'COM4'; my $config_file = 'thermo.cfg'; my $port = new Win32::SerialPort($port_name, $config_file) || die "Unable to open: $^E\n"; my $status = pack('HHHHHH', 'ca', '00', '01', '00', '00', 'fe'); $port->write($status."\n"); sleep 1; my $result = $port->input; print "result = $result\n"; $port->close || warn "Close Failed!\n"; undef $port;