in reply to How to read serial port with WIN32:SerialPort?

Hello mastertone and welcome to (the number of writers in) the monastery!

Maybe unrelated but as you are on Windows and using a 64bit perl (assuming this from the path name) you might be interested in Win32::SerialPort finally fixed for 64 bit Perl leading to this fix.

Also show the Win32::SerialPort version you are using, even if the last version in CPAN is 6 years holder than the above mentioned fix, so.. :)

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: How to read serial port with Win32::SerialPort?
by haukex (Archbishop) on Apr 16, 2021 at 13:01 UTC
    Maybe unrelated but as you are on Windows and using a 64bit perl (assuming this from the path name) you might be interested in Win32::SerialPort finally fixed for 64 bit Perl leading to this fix.

    I can confirm that I can reproduce the bug using the OP's code with the $PortObj->read(1) method on a 64-bit Strawberry Perl, but the same code does not produce the error on a 32-bit version.