in reply to (OT) How to emulate a serial port under Win32?

To add to GrandFather's suggestion, take a look at Test::MockModule which, as the description says "lets you temporarily redefine subroutines in other packages for the purposes of unit testing." You can substitute you're own sub for the sub that's returning the the bytes to your program, without touching that module, and do it all from your ".t" testing routines, leaving your production code intact.

The book O'Reilly book Perl Testing: A Developer's Notebook, co-authored by Chromatic (seen here on PM), provides some very good guidance on this and other testing techniques. It's an excellent resource, and very concise. Each chapter and section can be pretty much read on it's own, so you can pick out the parts you need quickly.

  • Comment on Re: (OT) How to emulate a serial port under Win32?