#! C:\perl\bin\perl.exe use strict; use warnings; use Win32::SerialPort; my $port_name = 'COM5'; my $config_file = 'setup.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("ati"."\n"); sleep 0; my $debug = 1; while(1) { my $line = $port->lookfor(); if( $line ) { { local $/ = "\r"; chomp $line; } if ($debug) { print "[$line]" ;} # Some data processing takes place } else { sleep(1); # Allocate time for other processes to run print "."; } } ======================= Response ================== .......