http://www.perlmonks.org?node_id=665624

apotheon has asked for the wisdom of the Perl Monks concerning the following question:

It looks like I'll have need to write code that accesses data from either an RS-232 serial port or a USB port (I'm not sure which, yet). At minimum, I'll need to do so on both FreeBSD and Debian GNU/Linux (FreeBSD first as the development platform), so a certain amount of portability across OSes is important.

The purpose of the code will be for sensor testing -- in the sense of gathering sensor output, then filtering and organizing to provide some kind of useful information to the computer user. As such, what I basically need is some way to access the serial or USB port and grab data in some kind of textual form that I can operate on with regexen, et cetera. I imagine there's a Perl module for this out there somewhere (isn't there one for everything else, including doing dishes and making coffee?), but everything I've found so far seems to be either specific to a device type, for using a fake serial port to test code, or specific to MS Windows. Maybe I'm just searching incorrectly.

Anyway . . . suggestions for the best module or techniques to use would be much appreciated, especially with some explanation for why it's the best (even if that explanation is "It's the only way I know how!").

print substr("Just another Perl hacker", 0, -2);
- apotheon
CopyWrite Chad Perrin