in reply to Very light weight GPS position

Hello!
I tried the code from the original post on Windows XP, ActivePerl 5.8.7 Build 815 with a Garmin GPS 12CX attached to COM4 and it didn't work.
No worries though.
So... I put together a variation of the original post using GPS::Garmin which is a subset module to perl::GPS
I have posted the "new code" below.
++ to the original author for inspiring me to dig further and find this module to interface with my Garmin! Yet Another Cool Use For Perl!
Important Note: Garmin::GPS on Win32 wants to see installed Win32::SerialPort, however, ActiveState does not appear to offer it for perl 5.8 and above. I did a little digging and installed it directly via the ppm prompt by issuing the command
ppm>install http://www.bribes.org/perl/ppm/Win32-SerialPort.ppd
With that little problem solved the script below works quite well.
#!/usr/bin/perl use warnings; use strict; use Tk; use GPS::Garmin; use Win32::SerialPort; my $mw = MainWindow->new; $mw->withdraw; my $location; my $gps = new GPS::Garmin( 'Port' => 'COM4', 'Baud' => 9600, ); my ($latsign,$lat,$lonsign,$lon) = $gps->get_position; my ($sec,$min,$hour,$mday,$mon,$year) = $gps->get_time; my $time="$hour:$min:$sec"; $lat=sprintf("%.4f",$lat); $lon=sprintf("%.4f",$lon); $location="$lat$latsign $lon$lonsign"; my $locationandtime="$lat$latsign $lon$lonsign\n$time"." GMT"; $mw->messageBox ( -message => $locationandtime, -title => 'Time and location', -type + => 'Ok' );
I am thinking more possibilities for tinkering there will soon be! :)