$lat =~ tr/0-9//cd; $lat =~ /^(..)(..)(..(?:[.].)?)$/; my ($deg, $min, $sec) = ($1, $2, int($3));