Anyone successfully talk to a serial port using perl?

IronWing

No Lifer
Jul 20, 2001
70,780
29,955
136
I have a perl script for geo-tagging photos and writing KML files. As things stand I have to use a third party program to download the tracklogs from the GPS. I would like to download the tracklogs directly within my script but I have had no luck in talking to the serial port. I'm using Win XP and ActivePerl. I've tried loading the Win32::Serialport module (required by the GPS module) but can't get it to run. It depends on WIN32 and WIN32API modules so I installed those. All failures.

If I can find a way to at least talk to the serial port I can probably write the rest myself and skip the GPS module and all its dependencies. Any ideas?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,417
4,186
75
OSes tend to have ways of talking with these old ports. You might try something like:

open(OUT,'>COM1');
print OUT 'My data';
close OUT;

I used to use >COM1 from the command line to talk to an external modem all the time. If you have one lying around, plug in a phone line, send "atd\n", and if you hear a dial tone, it's working. (Send "ath\n" to hang up.)
 

IronWing

No Lifer
Jul 20, 2001
70,780
29,955
136
I'm talking to the port now and can download data from the GPS. It still isn't quite right. The perl-GPS module ranks way up there as having the worst documentation I have ever seen (not seen). Talking to the port is really slow. It took over five minutes to download 40 waypoints. So far, it has taken 15 minutes and counting to download a 465 point tracklog. Back to the drawing board.