R
Richard S Beckett
Guys,
I have managed to get this far in my quest to capture data sent into the
serial port with windows...
use strict;
use warnings;
use Win32::SerialPort;
my $port = new Win32::SerialPort ("COM1") || die "can't open COM1\n";
open (FILE, ">file.txt");
foreach (1..100000) {
my $input;
if ($input = $port->input) {print FILE "$input\n"}
}
print "Finished\n";
close FILE;
This seems to work OK, unless I get a zero sent into the port. I can't work
out how to trap the zero, and distinguish it from no input.
Can someone help me out, please?
Thanks.
I have managed to get this far in my quest to capture data sent into the
serial port with windows...
use strict;
use warnings;
use Win32::SerialPort;
my $port = new Win32::SerialPort ("COM1") || die "can't open COM1\n";
open (FILE, ">file.txt");
foreach (1..100000) {
my $input;
if ($input = $port->input) {print FILE "$input\n"}
}
print "Finished\n";
close FILE;
This seems to work OK, unless I get a zero sent into the port. I can't work
out how to trap the zero, and distinguish it from no input.
Can someone help me out, please?
Thanks.