sub_getgps.pl 548 Bytes
sub sub_getgps {
	print ">> Use GPS...? [y/n] 	 				: " ;
	chop($gpsans = <STDIN>) ;
	print "\n" ;
	if ($gpsans =~ /[yY]/) {
	print ">> Port name...?  	 				: " ;
	chop($gpsport = <STDIN>) ;
	print "\n" ;
	print ">> Baud rate...?  	 				: " ;
	chop($gpsbaud = <STDIN>) ;
	print "\n" ;
	$gps = new GPS::NMEA(  'Port'      => "$gpsport",
	                       'Baud'      =>  $gpsbaud,
			);	
	$gpson = 1 ;
	} else {
	$gpson   = 0 ;
	$gpsport = "NaN" ;
	$gpsbaud = "NaN" ;
	$gps     = "NaN" ;
	}
	
	
	return ($gps,$gpson,$gpsport,$gpsbaud) ;
}

1;