in reply to Counting bytes in an input stream instead of a file

Take another look at the Win32::SerialPort docs... Way down in the "NOTES" section, there's an example of using tie to associate a filehandle with the serial port. It looks like that should then allow you to use read.