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

Greetings,
I have a data stream that I recieve on a com port, I want to save the data as files in dirs, so on.

how can I open a com port in perl?
any ideas?

thanks
Kevin

update (broquaint): title change (was Com ports)

  • Comment on Reading from serial ports on DOS/Windows

Replies are listed 'Best First'.
Re: Reading from serial ports on DOS/Windows
by Necos (Friar) on May 01, 2003 at 17:46 UTC
    If you go to search.cpan.org and look for 'serial', you should be able to find a module or two for the linux/bsd/*nix series of OSes. I believe there is also a Win32::Serial module or something similar.

    In the case of the non-Win32 world, make sure that you have permission to read/write from /dev/ttyS0 or /dev/ttyS1 (or whichever serial port you're using).

    Hope that helps.

    Theodore Charles III
    Network Administrator
    Los Angeles Senior High
    email->secon_kun@hotmail.com
    perl -e "map{print++$_}split//,Mdbnr;"